[04/28] x86: Make vp3dsp.asm independent of dsputil

Message ID 1365586623-82165-1-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö April 10, 2013, 9:37 a.m.
From: "Ronald S. Bultje" <rsbultje@gmail.com>

---
 libavcodec/x86/dsputil_mmx.c |    3 ---
 libavcodec/x86/dsputil_mmx.h |    3 ---
 libavcodec/x86/vp3dsp.asm    |    7 ++++---
 3 files changed, 4 insertions(+), 9 deletions(-)

Comments

Kostya Shishkov April 10, 2013, 9:42 a.m. | #1
On Wed, Apr 10, 2013 at 12:37:02PM +0300, Martin Storsjö wrote:
> From: "Ronald S. Bultje" <rsbultje@gmail.com>
> 
> ---
>  libavcodec/x86/dsputil_mmx.c |    3 ---
>  libavcodec/x86/dsputil_mmx.h |    3 ---
>  libavcodec/x86/vp3dsp.asm    |    7 ++++---
>  3 files changed, 4 insertions(+), 9 deletions(-)

I'd say "move constants to the only place where they are used" but that's me.
The patch looks OK 

> diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
> index 9ea9cca..adda822 100644
> --- a/libavcodec/x86/vp3dsp.asm
> +++ b/libavcodec/x86/vp3dsp.asm
> @@ -33,12 +33,13 @@ vp3_idct_data: times 8 dw 64277
>                 times 8 dw 25080
>                 times 8 dw 12785
>  
> +pb_7: times 8 db 7
> +pb_1F: times 8 db 0x1f
> +pb_81: times 8 db 0x81

a bit of vertical alignment maybe?
Martin Storsjö April 10, 2013, 9:46 a.m. | #2
On Wed, 10 Apr 2013, Kostya Shishkov wrote:

> On Wed, Apr 10, 2013 at 12:37:02PM +0300, Martin Storsjö wrote:
>> From: "Ronald S. Bultje" <rsbultje@gmail.com>
>>
>> ---
>>  libavcodec/x86/dsputil_mmx.c |    3 ---
>>  libavcodec/x86/dsputil_mmx.h |    3 ---
>>  libavcodec/x86/vp3dsp.asm    |    7 ++++---
>>  3 files changed, 4 insertions(+), 9 deletions(-)
>
> I'd say "move constants to the only place where they are used" but that's me.

Changed locally

> The patch looks OK
>
>> diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
>> index 9ea9cca..adda822 100644
>> --- a/libavcodec/x86/vp3dsp.asm
>> +++ b/libavcodec/x86/vp3dsp.asm
>> @@ -33,12 +33,13 @@ vp3_idct_data: times 8 dw 64277
>>                 times 8 dw 25080
>>                 times 8 dw 12785
>>
>> +pb_7: times 8 db 7
>> +pb_1F: times 8 db 0x1f
>> +pb_81: times 8 db 0x81
>
> a bit of vertical alignment maybe?

Fixed locally as well

// Martin

Patch

diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 7af11b0..4871069 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -47,10 +47,7 @@  DECLARE_ALIGNED(8,  const uint64_t, ff_pw_255)  =   0x00ff00ff00ff00ffULL;
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_512)  = { 0x0200020002000200ULL, 0x0200020002000200ULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_1019) = { 0x03FB03FB03FB03FBULL, 0x03FB03FB03FB03FBULL };
 
-DECLARE_ALIGNED(8,  const uint64_t, ff_pb_7)    =   0x0707070707070707ULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pb_1F)   =   0x1F1F1F1F1F1F1F1FULL;
 DECLARE_ALIGNED(8,  const uint64_t, ff_pb_3F)   =   0x3F3F3F3F3F3F3F3FULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pb_81)   =   0x8181818181818181ULL;
 DECLARE_ALIGNED(8,  const uint64_t, ff_pb_FC)   =   0xFCFCFCFCFCFCFCFCULL;
 
 DECLARE_ALIGNED(16, const double, ff_pd_1)[2] = { 1.0, 1.0 };
diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h
index d4a7754..b8245c8 100644
--- a/libavcodec/x86/dsputil_mmx.h
+++ b/libavcodec/x86/dsputil_mmx.h
@@ -49,10 +49,7 @@  extern const uint64_t ff_pw_255;
 
 extern const xmm_reg  ff_pb_1;
 extern const xmm_reg  ff_pb_3;
-extern const uint64_t ff_pb_7;
-extern const uint64_t ff_pb_1F;
 extern const uint64_t ff_pb_3F;
-extern const uint64_t ff_pb_81;
 extern const xmm_reg  ff_pb_F8;
 extern const uint64_t ff_pb_FC;
 
diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
index 9ea9cca..adda822 100644
--- a/libavcodec/x86/vp3dsp.asm
+++ b/libavcodec/x86/vp3dsp.asm
@@ -33,12 +33,13 @@  vp3_idct_data: times 8 dw 64277
                times 8 dw 25080
                times 8 dw 12785
 
+pb_7: times 8 db 7
+pb_1F: times 8 db 0x1f
+pb_81: times 8 db 0x81
+
 cextern pb_1
 cextern pb_3
-cextern pb_7
-cextern pb_1F
 cextern pb_80
-cextern pb_81
 
 cextern pw_8