[vlc-commits] avcodec: avoid duplicate vlc_CPU() call
Rémi Denis-Courmont
git at videolan.org
Sat Oct 13 13:55:11 CEST 2012
vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 13 14:51:48 2012 +0300| [d879cd1f604016533ec76bef6771a74c409e5e81] | committer: Rémi Denis-Courmont
avcodec: avoid duplicate vlc_CPU() call
(cherry picked from commit 18d7c9713c4b42368789961af6bc6345ce1fc6f9)
Conflicts:
modules/codec/avcodec/copy.c
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=d879cd1f604016533ec76bef6771a74c409e5e81
---
modules/codec/avcodec/copy.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/modules/codec/avcodec/copy.c b/modules/codec/avcodec/copy.c
index 909932f..d0a8779 100644
--- a/modules/codec/avcodec/copy.c
+++ b/modules/codec/avcodec/copy.c
@@ -298,11 +298,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,
@@ -318,11 +315,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,
@@ -369,7 +363,8 @@ void CopyFromNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
#ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU();
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
(void) cache;
#endif
@@ -390,7 +385,8 @@ void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
#ifdef CAN_COMPILE_SSE2
unsigned cpu = vlc_CPU();
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
(void) cache;
#endif
More information about the vlc-commits
mailing list