libavcodec/mips/mpegaudiodsp_mips_fixed.c File Reference

Reference: libavcodec/mpegaudiodsp_template.c. More...

#include <string.h>
#include "libavcodec/mpegaudiodsp.h"

Go to the source code of this file.

Functions

static void ff_mpadsp_apply_window_mips_fixed (int32_t *synth_buf, int32_t *window, int *dither_state, int16_t *samples, int incr)
static void imdct36_mips_fixed (int *out, int *buf, int *in, int *win)
static void ff_imdct36_blocks_mips_fixed (int *out, int *buf, int *in, int count, int switch_point, int block_type)
void ff_mpadsp_init_mipsdspr1 (MPADSPContext *s)


Detailed Description

Reference: libavcodec/mpegaudiodsp_template.c.

Definition in file mpegaudiodsp_mips_fixed.c.


Function Documentation

static void ff_imdct36_blocks_mips_fixed ( int out,
int buf,
int in,
int  count,
int  switch_point,
int  block_type 
) [static]

Definition at line 880 of file mpegaudiodsp_mips_fixed.c.

Referenced by ff_mpadsp_init_mipsdspr1().

static void ff_mpadsp_apply_window_mips_fixed ( int32_t *  synth_buf,
int32_t *  window,
int dither_state,
int16_t samples,
int  incr 
) [static]

use of round_sample function from the original code is eliminated, changed with appropriate assembly instructions.

Definition at line 59 of file mpegaudiodsp_mips_fixed.c.

Referenced by ff_mpadsp_init_mipsdspr1().

void ff_mpadsp_init_mipsdspr1 ( MPADSPContext s  ) 

Definition at line 899 of file mpegaudiodsp_mips_fixed.c.

Referenced by ff_mpadsp_init().

static void imdct36_mips_fixed ( int out,
int buf,
int in,
int win 
) [static]

Original constants are multiplied by two in advanced for assembly optimization (e.g. C_2 = 2 * C2). That can lead to overflow in operations where they are used.

Example of the solution:

in original code: t0 = ((int64_t)(in1[2*2] + in1[2*4]) * (int64_t)(2*C2))>>32

in assembly: C_2 = 2 * C2; "lw %[t7], 4*4(%[in1]) \n\t" "lw %[t8], 8*4(%[in1]) \n\t" "addu %[temp_reg2],%[t7], %[t8] \n\t" "multu %[C_2], %[temp_reg2] \n\t" "mfhi %[temp_reg1] \n\t" "sra %[temp_reg2],%[temp_reg2],31 \n\t" "move %[t0], $0 \n\t" "movn %[t0], %[C_2], %[temp_reg2] \n\t" "sub %[t0], %[temp_reg1],%[t0] \n\t"

loop is unrolled four times

values defined in tables(icos36[] and icos36h[]) are not loaded from these tables - they are directly loaded in appropriate registers

Definition at line 349 of file mpegaudiodsp_mips_fixed.c.

Referenced by ff_imdct36_blocks_mips_fixed().


Generated on Fri Oct 26 02:50:06 2012 for FFmpeg by  doxygen 1.5.8