[Mesa-dev] [PATCH v2 2/2] st/omx/h264: fix corruption when scaling matrix present flag is set

Ilia Mirkin imirkin at alum.mit.edu
Mon Feb 1 17:59:56 UTC 2016


On Mon, Feb 1, 2016 at 12:35 PM, Leo Liu <leo.liu at amd.com> wrote:
> The scaling list should be filled out with zig zag scan
>
> v2: integrate zig zag scan for list 4x4 to vl(Christian)
>
> Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Leo Liu <leo.liu at amd.com>
> ---
>  src/gallium/state_trackers/omx/vid_dec_h264.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/omx/vid_dec_h264.c b/src/gallium/state_trackers/omx/vid_dec_h264.c
> index f66ed89..f17be91 100644
> --- a/src/gallium/state_trackers/omx/vid_dec_h264.c
> +++ b/src/gallium/state_trackers/omx/vid_dec_h264.c
> @@ -35,6 +35,7 @@
>  #include "util/u_memory.h"
>  #include "util/u_video.h"
>  #include "vl/vl_rbsp.h"
> +#include "vl/vl_zscan.h"
>
>  #include "entrypoint.h"
>  #include "vid_dec.h"
> @@ -215,6 +216,7 @@ static void scaling_list(struct vl_rbsp *rbsp, uint8_t *scalingList, unsigned si
>     }
>
>     for (i = 0; i < sizeOfScalingList; ++i ) {
> +      unsigned scan = (sizeOfScalingList == 16) ? vl_zscan_normal_16[i] : vl_zscan_normal[i];

Perhaps determine the list just once rather than on each loop iter?
Also (and more importantly) it appears like you forgot to add
vl_zscan_normal_16?

>
>        if (nextScale != 0) {
>           signed delta_scale = vl_rbsp_se(rbsp);
> @@ -224,8 +226,8 @@ static void scaling_list(struct vl_rbsp *rbsp, uint8_t *scalingList, unsigned si
>              return;
>           }
>        }
> -      scalingList[i] = nextScale == 0 ? lastScale : nextScale;
> -      lastScale = scalingList[i];
> +      scalingList[scan] = nextScale == 0 ? lastScale : nextScale;
> +      lastScale = scalingList[scan];
>     }
>  }
>
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list