[FFmpeg-soc] [soc]: r5794 - libavfilter/vf_overlay.c

stefano subversion at mplayerhq.hu
Wed May 12 01:42:46 CEST 2010


Author: stefano
Date: Wed May 12 01:42:46 2010
New Revision: 5794

Log:
Revert r5782. 

bpp was 1 for yuv before that change, after the change it was 2.
bpp is used to offset x from pic->data per component, which is not
related to the value av_get_bits_per_pixel() returns.

Spotted by Baptiste, +12.353l to me.

Modified:
   libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==============================================================================
--- libavfilter/vf_overlay.c	Wed May 12 00:00:00 2010	(r5793)
+++ libavfilter/vf_overlay.c	Wed May 12 01:42:46 2010	(r5794)
@@ -24,7 +24,6 @@
  */
 
 #include "avfilter.h"
-#include "libavutil/pixdesc.h"
 #include "libavcodec/eval.h"
 #include "libavutil/avstring.h"
 
@@ -107,9 +106,28 @@ static int config_input_main(AVFilterLin
 {
     OverlayContext *over = link->dst->priv;
 
-    over->bpp = (av_get_bits_per_pixel(&av_pix_fmt_descriptors[link->format]) + 7) >> 3;
-    over->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
-    over->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
+    switch(link->format) {
+    case PIX_FMT_RGB32:
+    case PIX_FMT_BGR32:
+        over->bpp = 4;
+        break;
+    case PIX_FMT_RGB24:
+    case PIX_FMT_BGR24:
+        over->bpp = 3;
+        break;
+    case PIX_FMT_RGB565:
+    case PIX_FMT_RGB555:
+    case PIX_FMT_BGR565:
+    case PIX_FMT_BGR555:
+    case PIX_FMT_GRAY16BE:
+    case PIX_FMT_GRAY16LE:
+        over->bpp = 2;
+        break;
+    default:
+        over->bpp = 1;
+    }
+
+    avcodec_get_chroma_sub_sample(link->format, &over->hsub, &over->vsub);
 
     return 0;
 }


More information about the FFmpeg-soc mailing list