[vlc-devel] [PATCH 21/21] Work in progress for fixing handling of QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka

Martin Storsjö martin at martin.st
Mon Sep 5 14:31:25 CEST 2011


This is only a hack that isn't finished yet, disregard.
---
 modules/codec/omxil/utils.cpp |   49 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/modules/codec/omxil/utils.cpp b/modules/codec/omxil/utils.cpp
index 5ef3e4c..414b4bc 100644
--- a/modules/codec/omxil/utils.cpp
+++ b/modules/codec/omxil/utils.cpp
@@ -179,6 +179,55 @@ void CopyOmxPicture( decoder_t *p_dec, picture_t *p_pic,
         return;
     }
 
+    if( p_dec->p_sys->out.definition.format.video.eColorFormat == QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka )
+    {
+        p_dst = p_pic->p[0].p_pixels;
+        i_dst_stride = p_pic->p[0].i_pitch;
+        i_width = p_pic->p[0].i_visible_pitch;
+
+        for( i_line = 0; i_line < p_pic->p[0].i_visible_lines; i_line++ )
+        {
+            vlc_memcpy( p_dst, p_src, i_width );
+/*
+            int x;
+            for (x = 0; x < 64; x++) {
+                int i;
+                for (i = 0; i < i_width/64; i++)
+                    p_dst[(i_width/64)*x + i] = p_src[64*i + x];
+            }
+*/
+            p_src += i_src_stride;
+            p_dst += i_dst_stride;
+        }
+        memset(p_pic->p[1].p_pixels, 0x80, p_pic->p[1].i_pitch * p_pic->p[1].i_visible_lines);
+        memset(p_pic->p[2].p_pixels, 0x80, p_pic->p[2].i_pitch * p_pic->p[2].i_visible_lines);
+
+        i_src_stride /= p_sys->out.i_frame_stride_chroma_div;
+        p_dst = p_pic->p[1].p_pixels;
+        i_dst_stride = p_pic->p[1].i_pitch;
+        i_width = p_pic->p[1].i_visible_pitch;
+        p_dst2 = p_pic->p[2].p_pixels;
+        i_dst_stride2 = p_pic->p[2].i_pitch;
+
+        for( i_line = 0; i_line < p_pic->p[1].i_visible_lines; i_line++ )
+        {
+            uint8_t *d1 = p_dst;
+            uint8_t *d2 = p_dst2;
+            uint8_t *s  = p_src;
+            int x;
+            for( x = 0; x < i_width; x++ )
+            {
+                *d2++ = *s++;
+                *d1++ = *s++;
+            }
+            p_src += i_src_stride*2;
+            p_dst += i_dst_stride;
+            p_dst2 += i_dst_stride2;
+        }
+
+        return;
+    }
+
     for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
     {
         if(i_plane == 1) i_src_stride /= p_sys->out.i_frame_stride_chroma_div;
-- 
1.7.2.5




More information about the vlc-devel mailing list