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

avcodec: avoid duplicate vlc_CPU() call

(cherry picked from commit 18d7c9713c4b42368789961af6bc6345ce1fc6f9)

Conflicts:
	modules/codec/avcodec/copy.c
parent 3cdabb12
...@@ -298,11 +298,8 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch, ...@@ -298,11 +298,8 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
static void SSE_CopyFromNv12(picture_t *dst, static void SSE_CopyFromNv12(picture_t *dst,
uint8_t *src[2], size_t src_pitch[2], uint8_t *src[2], size_t src_pitch[2],
unsigned width, unsigned height, 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, SSE_CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch,
src[0], src_pitch[0], src[0], src_pitch[0],
cache->buffer, cache->size, cache->buffer, cache->size,
...@@ -318,11 +315,8 @@ static void SSE_CopyFromNv12(picture_t *dst, ...@@ -318,11 +315,8 @@ static void SSE_CopyFromNv12(picture_t *dst,
static void SSE_CopyFromYv12(picture_t *dst, static void SSE_CopyFromYv12(picture_t *dst,
uint8_t *src[3], size_t src_pitch[3], uint8_t *src[3], size_t src_pitch[3],
unsigned width, unsigned height, 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++) { for (unsigned n = 0; n < 3; n++) {
const unsigned d = n > 0 ? 2 : 1; const unsigned d = n > 0 ? 2 : 1;
SSE_CopyPlane(dst->p[n].p_pixels, dst->p[n].i_pitch, SSE_CopyPlane(dst->p[n].p_pixels, dst->p[n].i_pitch,
...@@ -369,7 +363,8 @@ void CopyFromNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2], ...@@ -369,7 +363,8 @@ void CopyFromNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
#ifdef CAN_COMPILE_SSE2 #ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU(); unsigned cpu = vlc_CPU();
if (cpu & CPU_CAPABILITY_SSE2) if (cpu & CPU_CAPABILITY_SSE2)
return SSE_CopyFromNv12(dst, src, src_pitch, width, height, cache); return SSE_CopyFromNv12(dst, src, src_pitch, width, height,
cache, cpu);
#else #else
(void) cache; (void) cache;
#endif #endif
...@@ -390,7 +385,8 @@ void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3], ...@@ -390,7 +385,8 @@ void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
#ifdef CAN_COMPILE_SSE2 #ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU(); unsigned cpu = vlc_CPU();
if (cpu & CPU_CAPABILITY_SSE2) if (cpu & CPU_CAPABILITY_SSE2)
return SSE_CopyFromYv12(dst, src, src_pitch, width, height, cache); return SSE_CopyFromYv12(dst, src, src_pitch, width, height,
cache, cpu);
#else #else
(void) cache; (void) cache;
#endif #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