6.2.6.9.3 Image Rotation And Mirroring

Image rotation or mirroring is produced by combining pixel and line striding to read image pixels in a different order, as shown in the figure below.

Figure 6-8. Rotation and Mirroring

The Configuration tables below show how to configure registers according to image transformation. The following notations are used:

  • FPA = original image First Pixel Address
  • Xs = original image horizontal number of pixels
  • Ys = original image vertical number of pixels
  • Ps = original image Pixel size expressed in byte (see Pixel Size Values)
  • HXs = floor{(Xs+1)/2} , the rounded half of Xs
  • HYs = floor{(Ys+1)/2} , the rounded half of Ys
    Table 6-46. Pixel Size Values
    Input ModePs Value (in bytes)
    12BPP_RGB_4442
    16BPP_ARGB_44442
    16BPP_RGBA_44442
    16BPP_RGB_5652
    16BPP_ARGB_15552
    18BPP_RGB_6664
    18BPP_RGB_666PACKED3
    19BPP_ARGB_16664
    19BPP_ARGB_PACKED3
    24BPP_RGB_8884
    24BPP_RGB_888_PACKED3
    25BPP_ARGB_18884
    32BPP_ARGB_88884
    32BPP_RGBA_88884
    32BPP_AYCBCR4
    16BPP_YCBCR_MODE01
    16BPP_YCBCR_MODE1
    16BPP_YCBCR_MODE2
    16BPP_YCBCR_MODE3
    16BPP_YCBCR_SEMIPLANAR
    16BPP_YCBCR_PLANAR
    12BPP_YCBCR_SEMIPLANAR
    12BPP_YCBCR_PLANAR
    Table 6-47. Rotation Configuration (All Input Modes, All Overlays)
    Rotation Angle90°180°270°
    FBAFPAFPA + (Xs-1)*PsFPA + (Xs*Ys - 1)*PsFPA + Xs*(Ys-1)*Ps
    XSIZE/XMEMSIZEXs-1Ys-1Xs-1Ys-1
    YSIZE/YMEMSIZEYs-1Xs-1Ys-1Xs-1
    XSTRIDE0-((Ys-1)*Xs + 2)*Ps-2*PsXs*(Ys-1)*Ps
    PSTRIDE0(Xs-1)*Ps-2*Ps-(Xs+1)*Ps

For rotation transformation in High-End Overlay with YCbCr planar and semi-planar modes, additional registers must be configured, as shown in the following tables.

Table 6-48. YCbCr 4:2:2 Semi-planar Specific Rotation Configuration
Rotation Angle90°180°270°
HEOCFG1.YCC422ROT0101
HEOCBFBA0FPAFPA + 2*HXs - 2FPA + 2*HXs*Ys - 2FPA + 2*HXs*(Ys-1)
HEOCFG7.CCXSTRIDE0-2*HXs*(Ys-1) - 4-42*HXs*(Ys-1)
HEOCFG8.CCPSTRIDE02*HXs - 2-4-2*HXs - 2
Table 6-49. YCbCr 4:2:2 Planar Specific Rotation Configuration
Rotation Angle90°180°270°
HEOCFG1.YCC422ROT0101
HEOCBFBA0FPAFPA + HXs - 1FPA + HXs*Ys - 1FPA + HXs*(Ys-1)
HEOCRFBA0FPAFPA + HXs - 1FPA + HXs*Ys - 1FPA + HXs*(Ys-1)
HEOCFG7.CCXSTRIDE0-HXs*(Ys-1) - 2-2HXs*(Ys-1)
HEOCFG8.CCPSTRIDE0HXs - 1-2-HXs - 1
Table 6-50. YCbCr 4:2:0 Semi-planar Specific Rotation Configuration
Rotation Angle90°180°270°
HEOCBFBA0FPAFPA + 2*HXs - 2FPA + 2*HXs*HYs - 2FPA + 2*HXs*(HYs-1)
HEOCFG7.CCXSTRIDE0-2*HXs*(HYs-1) - 4-42*HXs*(HYs-1)
HEOCFG8.CCPSTRIDE02*HXs - 2-4-2*HXs - 2
Table 6-51. YCbCr 4:2:0 Planar Specific Rotation Configuration
Rotation Angle90°180°270°
HEOCBFBA0FPAFPA + HXs - 1FPA + HXs*Ys - 1FPA + HXs*(HYs-1)
HEOCRFBA0FPAFPA + HXs - 1FPA + HXs*Ys - 1FPA + HXs*(HYs-1)
HEOCFG7.CCXSTRIDE0-HXs*(HYs-1) - 2-2HXs*(HYs-1)
HEOCFG8.CCPSTRIDE0HXs - 1-2-HXs - 1
Table 6-52. Mirroring Configuration (All Input Modes, All Overlays)
Mirroring AxisVerticalHorizontal
FBAFPA + (Xs-1)*PsFPA + Xs*(Ys-1)*Ps
XSIZE/XMEMSIZEXs-1Xs-1
YSIZE/YMEMSIZEYs-1Ys-1
XSTRIDE2*(Xs-1)*Ps-2*Xs*Ps
PSTRIDE-2*Ps0

For mirroring transformation in High-End Overlay with YCbCr planar and semi-planar modes, additional registers have to be configured, as shown in the following tables.

Table 6-53. YCbCr 4:2:2 Semi-planar Specific Mirroring Configuration
Mirroring AxisVerticalHorizontal
HEOCBFBA0FPA + 2*HXs - 2FPA + 2*HXs*(Ys-1)
HEOCFG7.CCXSTRIDE4*HXs - 4-4*HXs
HEOCFG8.CCPSTRIDE-40
Table 6-54. YCbCr 4:2:2 Planar Specific Mirroring Configuration
Mirroring AxisVerticalHorizontal
HEOCBFBA0FPA + HXs - 1FPA + HXs*(Ys-1)
HEOCRFBA0FPA + HXs - 1FPA + HXs*(Ys-1)
HEOCFG7.CCXSTRIDE2*HXs - 2-2HXs
HEOCFG8.CCPSTRIDE-20
Table 6-55. YCbCr 4:2:0 Semi-planar Specific Mirroring Configuration
Mirroring AxisVerticalHorizontal
HEOCBFBA0FPA + 2*HXs - 2FPA + 2*HXs*(HYs-1)
HEOCFG7.CCXSTRIDE4*HXs - 4-4*HXs
HEOCFG8.CCPSTRIDE-40
Table 6-56. YCbCr 4:2:0 Planar Specific Mirroring Configuration
Mirroring AxisVerticalHorizontal
HEOCBFBA0FPA + HXs - 1FPA + HXs*(HYs-1)
HEOCRFBA0FPA + HXs - 1FPA + HXs*(HYs-1)
HEOCFG7.CCXSTRIDE2*HXs - 2-2HXs
HEOCFG8.CCPSTRIDE-20