Go to the documentation of this file.
131 for(
i = 0;
i < 8;
i++){
134 for(j = 0; j <
i; j++)
139 for(
i = 0;
i < 8;
i++)
150 for(
i = 0;
i < 8;
i++){
155 for(
i = 0;
i < 8;
i++){
160 for(
i = 0;
i < 8;
i++){
168 int16_t
tmp[146 + 60], *ptr0, *ptr1;
177 for(
i = 0;
i < 146;
i++)
179 off = (t / 25) + dec->
offset1[quart >> 1] + 18;
180 off = av_clip(off, 0, 145);
181 ptr0 =
tmp + 145 - off;
184 for(
i = 0;
i < 60;
i++){
185 t = (ptr0[0] *
filter[0] + ptr0[1] *
filter[1] + 0x2000) >> 14;
200 memset(
out, 0, 60 *
sizeof(*
out));
201 for(
i = 0;
i < 7;
i++) {
210 for(
i = 0, j = 3; (
i < 30) && (j > 0);
i++){
220 coef = dec->
pulsepos[quart] & 0x7FFF;
222 for(
i = 30, j = 4; (
i < 60) && (j > 0);
i++){
240 for(
i = 0;
i < 60;
i++){
250 int16_t *ptr0, *ptr1;
253 ptr1 = dec->
filters + quart * 8;
254 for(
i = 0;
i < 60;
i++){
256 for(k = 0; k < 8; k++)
257 sum += ptr0[k] * (
unsigned)ptr1[k];
258 sum =
out[
i] + ((
int)(sum + 0x800U) >> 12);
259 out[
i] = av_clip(sum, -0x7FFE, 0x7FFE);
260 for(k = 7; k > 0; k--)
261 ptr0[k] = ptr0[k - 1];
265 for(
i = 0;
i < 8;
i++)
269 for(
i = 0;
i < 60;
i++){
271 for(k = 0; k < 8; k++)
272 sum += ptr0[k] * t[k];
273 for(k = 7; k > 0; k--)
274 ptr0[k] = ptr0[k - 1];
276 out[
i] += (- sum) >> 12;
279 for(
i = 0;
i < 8;
i++)
283 for(
i = 0;
i < 60;
i++){
284 int sum =
out[
i] * (1 << 12);
285 for(k = 0; k < 8; k++)
286 sum += ptr0[k] * t[k];
287 for(k = 7; k > 0; k--)
288 ptr0[k] = ptr0[k - 1];
289 ptr0[0] = av_clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
291 sum = ((ptr0[1] * (dec->
filtval - (dec->
filtval >> 2))) >> 4) + sum;
292 sum = sum - (sum >> 3);
293 out[
i] = av_clip((sum + 0x800) >> 12, -0x7FFE, 0x7FFE);
301 for(
i = 0;
i < 8;
i++)
302 c->prevfilt[
i] =
c->cvector[
i];
306 int *got_frame_ptr,
AVPacket *avpkt)
310 int buf_size = avpkt->
size;
317 iterations = buf_size / 32;
321 "Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size);
326 frame->nb_samples = iterations * 240;
333 for(j = 0; j < iterations; j++) {
340 for(
i = 0;
i < 4;
i++) {
357 .
name =
"truespeech",
static av_cold int init(AVCodecContext *avctx)
uint64_t channel_layout
Audio channel layout.
static av_cold int truespeech_decode_init(AVCodecContext *avctx)
#define AV_CH_LAYOUT_MONO
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
int flag
1-bit flag, shows how to choose filters
This structure describes decoded (raw) audio or video data.
int pulseoff[4]
4-bit offset of pulse values block
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 samples
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
int offset2[4]
7-bit value, encodes offsets for copying and for two-point filter
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int pulsepos[4]
27-bit variable, encodes 7 pulse positions
void(* bswap_buf)(uint32_t *dst, const uint32_t *src, int w)
static void truespeech_read_frame(TSContext *dec, const uint8_t *input)
static void truespeech_update_filters(TSContext *dec, int16_t *out, int quart)
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static const int16_t ts_decay_35_64[8]
static unsigned int get_bits1(GetBitContext *s)
static const int16_t ts_decay_3_4[8]
static const int16_t ts_pulse_scales[64]
static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int offset1[2]
8-bit value, used in one copying offset
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum AVSampleFormat sample_fmt
audio sample format
AVCodec ff_truespeech_decoder
int16_t vector[8]
input vector: 5/5/4/4/4/3/3/3
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
int channels
number of audio channels
#define DECLARE_ALIGNED(n, t, v)
static const int16_t ts_decay_994_1000[8]
static const int16_t ts_order2_coeffs[25 *2]
#define i(width, name, range_min, range_max)
TrueSpeech decoder context.
@ AV_SAMPLE_FMT_S16
signed 16 bits
const char * name
Name of the codec implementation.
static void truespeech_filters_merge(TSContext *dec)
static const int16_t *const ts_codebook[8]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
static void truespeech_save_prevvec(TSContext *c)
#define avpriv_request_sample(...)
This structure stores compressed data.
int pulseval[4]
7x2-bit pulse values
static void truespeech_synth(TSContext *dec, int16_t *out, int quart)
static const int16_t ts_pulse_values[120]
static int truespeech_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static void truespeech_correlate_filter(TSContext *dec)
static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)