[FFmpeg-devel] [PATCH 2/2] dxva2_h264: add a workaround for old intel GPUs

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Mar 4 19:45:00 CET 2014


On Tue, Mar 04, 2014 at 08:28:39AM +0100, Rainer Hochecker wrote:
> +    else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
> +        pp->Reserved16Bits            = 0x34c;

How is that related?

> @@ -238,7 +240,11 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
>              if (list < h->list_count && i < h->ref_count[list]) {
>                  const Picture *r = &h->ref_list[list][i];
>                  unsigned plane;
> -                unsigned index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));
> +                unsigned index;
> +                if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
> +                    index = ff_dxva2_get_surface_index(ctx, r);
> +                else
> +                    index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));

I'd say this looks nicer as
unsigned index = ff_dxva2_get_surface_index(ctx, r);
if (!(ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
    index = get_refpic_index(pp, index);

I also wonder if it wouldn't make more sense to merge into the previous
patch (though that also depends on the answer to my question about the
first part).
Also, would it be possible to auto-detect whether this should be used or
not?
Lastly, which devices does this fix? Is everything but the "ClearVideo"
ones broken currently, or is it only some special devices that even
care about this?


More information about the ffmpeg-devel mailing list