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

Leo Liu leo.liu at amd.com
Mon Feb 1 17:35:53 UTC 2016


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];
 
       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



More information about the mesa-dev mailing list