[01/13] bfin: Don't use the vp3 idct functions if bitexact behaviour is expected

Message ID 1364995179-98359-1-git-send-email-martin@martin.st
State Committed
Commit aa8d89536d35af0a0c8d8bac2b452ffe7b82cae5
Headers show

Commit Message

Martin Storsjö April 3, 2013, 1:19 p.m.
In the non-bitexact mode, vp3 currently decodes to the same
frame crcs as before 28f9ab702 (and the output visually looks
correct).
---
 libavcodec/bfin/vp3_bfin.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Luca Barbato April 3, 2013, 1:30 p.m. | #1
On 03/04/13 15:19, Martin Storsjö wrote:
> In the non-bitexact mode, vp3 currently decodes to the same
> frame crcs as before 28f9ab702 (and the output visually looks
> correct).
> ---
>  libavcodec/bfin/vp3_bfin.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c
> index 4b57714..ee45e3c 100644
> --- a/libavcodec/bfin/vp3_bfin.c
> +++ b/libavcodec/bfin/vp3_bfin.c
> @@ -53,6 +53,8 @@ void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block)
>  
>  av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
>  {
> -    c->idct_add = ff_bfin_vp3_idct_add;
> -    c->idct_put = ff_bfin_vp3_idct_put;
> +    if (!(flags & CODEC_FLAG_BITEXACT)) {
> +        c->idct_add = ff_bfin_vp3_idct_add;
> +        c->idct_put = ff_bfin_vp3_idct_put;
> +    }
>  }
> 

ok

Patch

diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c
index 4b57714..ee45e3c 100644
--- a/libavcodec/bfin/vp3_bfin.c
+++ b/libavcodec/bfin/vp3_bfin.c
@@ -53,6 +53,8 @@  void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block)
 
 av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
 {
-    c->idct_add = ff_bfin_vp3_idct_add;
-    c->idct_put = ff_bfin_vp3_idct_put;
+    if (!(flags & CODEC_FLAG_BITEXACT)) {
+        c->idct_add = ff_bfin_vp3_idct_add;
+        c->idct_put = ff_bfin_vp3_idct_put;
+    }
 }