[FFmpeg-cvslog] h264: avoid a grayscale related if() in hl_decode_mb()

Michael Niedermayer git at videolan.org
Fri Dec 28 21:02:21 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 28 20:38:41 2012 +0100| [07abf13da4a7c3d23ce6bc6542d72e6252161736] | committer: Michael Niedermayer

h264: avoid a grayscale related if() in hl_decode_mb()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07abf13da4a7c3d23ce6bc6542d72e6252161736
---

 libavcodec/h264_mb_template.c |    2 --
 libavcodec/h264pred.c         |    5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index b6adbf7..a110094 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -159,10 +159,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
                                uvlinesize, 1, 0, SIMPLE, PIXEL_SHIFT);
 
             if (SIMPLE || !CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
-                if (CHROMA) {
                 h->hpc.pred8x8[h->chroma_pred_mode](dest_cb, uvlinesize);
                 h->hpc.pred8x8[h->chroma_pred_mode](dest_cr, uvlinesize);
-                }
             }
 
             hl_decode_mb_predict_luma(h, mb_type, is_h264, SIMPLE,
diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c
index f83924d..db483c9 100644
--- a/libavcodec/h264pred.c
+++ b/libavcodec/h264pred.c
@@ -406,7 +406,7 @@ static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
  * Set the intra prediction function pointers.
  */
 void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth,
-                       const int chroma_format_idc)
+                       int chroma_format_idc)
 {
 //    MpegEncContext * const s = &h->s;
 
@@ -566,6 +566,9 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth,
     h->pred16x16_add[VERT_PRED8x8]= FUNCC(pred16x16_vertical_add          , depth);\
     h->pred16x16_add[ HOR_PRED8x8]= FUNCC(pred16x16_horizontal_add        , depth);\
 
+    if(!chroma_format_idc)
+        chroma_format_idc = 1;
+
     switch (bit_depth) {
         case 9:
             H264_PRED(9)



More information about the ffmpeg-cvslog mailing list