FFmpeg  4.3
Macros | Functions | Variables
g722.c File Reference
#include "mathops.h"
#include "g722.h"

Go to the source code of this file.

Macros

#define ACCUM(k, x, d)
 

Functions

static void s_zero (int cur_diff, struct G722Band *band)
 
static void do_adaptive_prediction (struct G722Band *band, const int cur_diff)
 adaptive predictor More...
 
static int linear_scale_factor (const int log_factor)
 
void ff_g722_update_low_predictor (struct G722Band *band, const int ilow)
 
void ff_g722_update_high_predictor (struct G722Band *band, const int dhigh, const int ihigh)
 

Variables

static const int8_t sign_lookup [2] = { -1, 1 }
 
static const int16_t inv_log2_table [32]
 
static const int16_t high_log_factor_step [2] = { 798, -214 }
 
const int16_t ff_g722_high_inv_quant [4] = { -926, -202, 926, 202 }
 
static const int16_t low_log_factor_step [16]
 low_log_factor_step[index] == wl[rl42[index]] More...
 
const int16_t ff_g722_low_inv_quant4 [16]
 
const int16_t ff_g722_low_inv_quant6 [64]
 

Detailed Description

G.722 ADPCM audio codec

This G.722 decoder is a bit-exact implementation of the ITU G.722 specification for all three specified bitrates - 64000bps, 56000bps and 48000bps. It passes the ITU tests.

Note
For the 56000bps and 48000bps bitrates, the lowest 1 or 2 bits respectively of each byte are ignored.

Definition in file g722.c.

Macro Definition Documentation

◆ ACCUM

#define ACCUM (   k,
  x,
 
)
Value:
do { \
int tmp = x; \
band->zero_mem[k] = ((band->zero_mem[k] * 255) >> 8) + \
d*((band->diff_mem[k]^cur_diff) < 0 ? -128 : 128); \
band->diff_mem[k] = tmp; \
s_zero += (tmp * band->zero_mem[k]) >> 15; \
} while (0)

Function Documentation

◆ s_zero()

static void s_zero ( int  cur_diff,
struct G722Band *  band 
)
inlinestatic

Definition at line 74 of file g722.c.

Referenced by do_adaptive_prediction().

◆ do_adaptive_prediction()

static void do_adaptive_prediction ( struct G722Band *  band,
const int  cur_diff 
)
static

adaptive predictor

Parameters
cur_diffthe dequantized and scaled delta calculated from the current codeword

Definition at line 110 of file g722.c.

Referenced by ff_g722_update_high_predictor(), and ff_g722_update_low_predictor().

◆ linear_scale_factor()

static int linear_scale_factor ( const int  log_factor)
inlinestatic

Definition at line 136 of file g722.c.

Referenced by ff_g722_update_high_predictor(), and ff_g722_update_low_predictor().

◆ ff_g722_update_low_predictor()

void ff_g722_update_low_predictor ( struct G722Band *  band,
const int  ilow 
)

Definition at line 143 of file g722.c.

Referenced by g722_decode_frame(), and g722_encode_trellis().

◆ ff_g722_update_high_predictor()

void ff_g722_update_high_predictor ( struct G722Band *  band,
const int  dhigh,
const int  ihigh 
)

Definition at line 154 of file g722.c.

Referenced by g722_decode_frame(), and g722_encode_trellis().

Variable Documentation

◆ sign_lookup

const int8_t sign_lookup[2] = { -1, 1 }
static

Definition at line 42 of file g722.c.

Referenced by do_adaptive_prediction().

◆ inv_log2_table

const int16_t inv_log2_table[32]
static
Initial value:
= {
2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383,
2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834,
2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371,
3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008
}

Definition at line 44 of file g722.c.

Referenced by linear_scale_factor().

◆ high_log_factor_step

const int16_t high_log_factor_step[2] = { 798, -214 }
static

Definition at line 50 of file g722.c.

Referenced by ff_g722_update_high_predictor().

◆ ff_g722_high_inv_quant

const int16_t ff_g722_high_inv_quant[4] = { -926, -202, 926, 202 }

Definition at line 51 of file g722.c.

Referenced by g722_decode_frame(), and g722_encode_trellis().

◆ low_log_factor_step

const int16_t low_log_factor_step[16]
static
Initial value:
= {
-60, 3042, 1198, 538, 334, 172, 58, -30,
3042, 1198, 538, 334, 172, 58, -30, -60
}

low_log_factor_step[index] == wl[rl42[index]]

Definition at line 55 of file g722.c.

Referenced by ff_g722_update_low_predictor().

◆ ff_g722_low_inv_quant4

const int16_t ff_g722_low_inv_quant4[16]
Initial value:
= {
0, -2557, -1612, -1121, -786, -530, -323, -150,
2557, 1612, 1121, 786, 530, 323, 150, 0
}

Definition at line 59 of file g722.c.

Referenced by ff_g722_update_low_predictor().

◆ ff_g722_low_inv_quant6

const int16_t ff_g722_low_inv_quant6[64]
Initial value:
= {
-17, -17, -17, -17, -3101, -2738, -2376, -2088,
-1873, -1689, -1535, -1399, -1279, -1170, -1072, -982,
-899, -822, -750, -682, -618, -558, -501, -447,
-396, -347, -300, -254, -211, -170, -130, -91,
3101, 2738, 2376, 2088, 1873, 1689, 1535, 1399,
1279, 1170, 1072, 982, 899, 822, 750, 682,
618, 558, 501, 447, 396, 347, 300, 254,
211, 170, 130, 91, 54, 17, -54, -17
}

Definition at line 63 of file g722.c.

Referenced by g722_encode_trellis().

tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:26
x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150