[vlc-devel] [PATCH] DXVA2: remove frame multithreading hack

Steve Lhomme robux4 at videolabs.io
Tue Apr 7 11:58:12 CEST 2015


Discard this patch.

Turns out the Intel Graphics 4000 doesn't work with frame
multithreading if thread_safe_callbacks is set. The decoded frame that
are extracted from DXVA aren't always clean. Maybe passing slices or
parts of previous frame references from different thread is not
supported.

So we should set thread_safe_callbacks to false for WIN32. The
performance impact when not using DXVA should be minimal. All buffer
pool access will be done through a worker thread.

Or we can keep the detection if DXVA2 is likely to be used for this
codec or not.

On Tue, Apr 7, 2015 at 11:01 AM, Steve Lhomme <robUx4 at videolabs.io> wrote:
> this hack is not necessary anymore
>
> --
> replaces patch "fix compatibility with avcodec frame multithreading"
>
> tweaking `thread_safe_callbacks` is not needed anymore
>
> apply with "lock the buffer pool when getting/releasing a buffer" and "avcodec VA: try to reuse the current video acceleration" patches
> ---
>  modules/codec/avcodec/video.c | 15 ---------------
>  1 file changed, 15 deletions(-)
>
> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
> index 5867427..439bd63 100644
> --- a/modules/codec/avcodec/video.c
> +++ b/modules/codec/avcodec/video.c
> @@ -396,21 +396,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
>              break;
>      }
>
> -    /* Workaround: frame multithreading is not compatible with
> -     * DXVA2. When a frame is being copied to host memory, the frame
> -     * is locked and cannot be used as a reference frame
> -     * simultaneously and thus decoding fails for some frames. This
> -     * causes major image corruption. */
> -# if defined(_WIN32)
> -    char *avcodec_hw = var_InheritString( p_dec, "avcodec-hw" );
> -    if( avcodec_hw == NULL || strcasecmp( avcodec_hw, "none" ) )
> -    {
> -        msg_Warn( p_dec, "threaded frame decoding is not compatible with DXVA2, disabled" );
> -        p_context->thread_type &= ~FF_THREAD_FRAME;
> -    }
> -    free( avcodec_hw );
> -# endif
> -
>      if( p_context->thread_type & FF_THREAD_FRAME )
>          p_dec->i_extra_picture_buffers = 2 * p_context->thread_count;
>  #endif
> --
> 2.3.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list