Commit 07d8e576 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: split generic YV12/NV12 copy out of SSE2 functions

This is required by the next commit. This also avoids making two copies
on non-x86 platforms, where USWC optimizations are irrelevant.
parent 7d6a8dd1
This diff is collapsed.
......@@ -25,8 +25,10 @@
#define _VLC_AVCODEC_COPY_H 1
typedef struct {
# ifdef CAN_COMPILE_SSE2
uint8_t *buffer;
size_t size;
# endif
} copy_cache_t;
int CopyInitCache(copy_cache_t *cache, unsigned width);
......
......@@ -322,7 +322,8 @@ static int CreateSurfaces( vlc_va_sys_t *p_va, void **pp_hw_ctx, vlc_fourcc_t *p
goto error;
*pi_chroma = i_chroma;
CopyInitCache( &p_va->image_cache, i_width );
if( unlikely(CopyInitCache( &p_va->image_cache, i_width )) )
goto error;
/* Setup the ffmpeg hardware context */
*pp_hw_ctx = &p_va->hw_ctx;
......@@ -370,9 +371,6 @@ static int Extract( vlc_va_t *p_external, picture_t *p_picture, AVFrame *p_ff )
{
vlc_va_sys_t *p_va = p_external->sys;
if( !p_va->image_cache.buffer )
return VLC_EGENERIC;
VASurfaceID i_surface_id = (VASurfaceID)(uintptr_t)p_ff->data[3];
#if VA_CHECK_VERSION(0,31,0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment