[FFmpeg-devel] [PATCH 3/4] avcodec/ppc/fdctdsp: use more accurate constants

Daniel Serpell dserpell at gmail.com
Mon Nov 16 15:48:06 CET 2015


Hi!,

El Fri, Nov 13, 2015 at 11:42:30AM -0500, Ganesh Ajjanagadde escribio:
> Whoever wrote this stuff had a pretty bad libm - digits differ pretty
> quickly.

They where correctly rounded to 24bit precision. I don't know if that
was intentional, so I can't comment on the correctness of the patch.

    Daniel.

> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavcodec/ppc/fdctdsp.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/libavcodec/ppc/fdctdsp.c b/libavcodec/ppc/fdctdsp.c
> index 924d12c..92866d3 100644
> --- a/libavcodec/ppc/fdctdsp.c
> +++ b/libavcodec/ppc/fdctdsp.c
> @@ -37,13 +37,13 @@
>  #define vu16(v) ((vector unsigned short) (v))
>  #define vu32(v)   ((vector unsigned int) (v))
>  
> -#define C1     0.98078525066375732421875000 /* cos(1 * PI / 16) */
> -#define C2     0.92387950420379638671875000 /* cos(2 * PI / 16) */
> -#define C3     0.83146959543228149414062500 /* cos(3 * PI / 16) */
> -#define C4     0.70710676908493041992187500 /* cos(4 * PI / 16) */
> -#define C5     0.55557024478912353515625000 /* cos(5 * PI / 16) */
> -#define C6     0.38268342614173889160156250 /* cos(6 * PI / 16) */
> -#define C7     0.19509032368659973144531250 /* cos(7 * PI / 16) */
> +#define C1     0.98078528040323044912618224 /* cos(1 * PI / 16) */
> +#define C2     0.92387953251128675612818319 /* cos(2 * PI / 16) */
> +#define C3     0.83146961230254523707878838 /* cos(3 * PI / 16) */
> +#define C4     M_SQRT1_2                    /* cos(4 * PI / 16) */
> +#define C5     0.55557023301960222474283081 /* cos(5 * PI / 16) */
> +#define C6     0.38268343236508977172845998 /* cos(6 * PI / 16) */
> +#define C7     0.19509032201612826784828487 /* cos(7 * PI / 16) */
>  
>  #define W0 -(2 * C2)
>  #define W1  (2 * C6)
> -- 
> 2.6.2
> 


More information about the ffmpeg-devel mailing list