Commit 18d7c971 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: avoid duplicate vlc_CPU() call

parent 0d5c56e0
......@@ -314,11 +314,8 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
static void SSE_CopyFromNv12(picture_t *dst,
uint8_t *src[2], size_t src_pitch[2],
unsigned width, unsigned height,
copy_cache_t *cache)
copy_cache_t *cache, unsigned cpu)
{
const unsigned cpu = vlc_CPU();
/* */
SSE_CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch,
src[0], src_pitch[0],
cache->buffer, cache->size,
......@@ -334,11 +331,8 @@ static void SSE_CopyFromNv12(picture_t *dst,
static void SSE_CopyFromYv12(picture_t *dst,
uint8_t *src[3], size_t src_pitch[3],
unsigned width, unsigned height,
copy_cache_t *cache)
copy_cache_t *cache, unsigned cpu)
{
const unsigned cpu = vlc_CPU();
/* */
for (unsigned n = 0; n < 3; n++) {
const unsigned d = n > 0 ? 2 : 1;
SSE_CopyPlane(dst->p[n].p_pixels, dst->p[n].i_pitch,
......@@ -385,7 +379,8 @@ void CopyFromNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
#ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU();
if (vlc_CPU_SSE2())
return SSE_CopyFromNv12(dst, src, src_pitch, width, height, cache);
return SSE_CopyFromNv12(dst, src, src_pitch, width, height,
cache, cpu);
#else
(void) cache;
#endif
......@@ -406,7 +401,8 @@ void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
#ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU();
if (vlc_CPU_SSE2())
return SSE_CopyFromYv12(dst, src, src_pitch, width, height, cache);
return SSE_CopyFromYv12(dst, src, src_pitch, width, height,
cache, cpu);
#else
(void) cache;
#endif
......
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