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

Baptiste Coudurier baptiste.coudurier at gmail.com
Wed May 12 00:54:21 CEST 2010


On 05/01/2010 03:44 PM, stefano wrote:
> Author: stefano
> Date: Sun May  2 00:44:49 2010
> New Revision: 5782
>
> Log:
> Make config_input_main() use pixdesc.h for computing chroma offsets
> and bits per pixel, simplify.
>
> Modified:
>     libavfilter/vf_overlay.c
>
> Modified: libavfilter/vf_overlay.c
> ==============================================================================
> --- libavfilter/vf_overlay.c	Sun May  2 00:17:55 2010	(r5781)
> +++ libavfilter/vf_overlay.c	Sun May  2 00:44:49 2010	(r5782)
> @@ -26,6 +26,7 @@
>   #include<stdio.h>
>
>   #include "avfilter.h"
> +#include "libavutil/pixdesc.h"
>   #include "libavcodec/eval.h"
>   #include "libavutil/avstring.h"
>
> @@ -108,28 +109,9 @@ static int config_input_main(AVFilterLin
>   {
>       OverlayContext *over = link->dst->priv;
>
> -    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);
> +    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;
>

Humm this seems to break the filter.
bpp was 1 for yuv before this change, now it is 2.
bpp is used to offset x from pic->data per component, which seems not 
related to the value av_get_bits_per_pixel returns.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org


More information about the FFmpeg-soc mailing list