[FFmpeg-cvslog] r21528 - in trunk/libavcodec: acelp_vectors.c acelp_vectors.h
rbultje
subversion
Fri Jan 29 17:49:06 CET 2010
Author: rbultje
Date: Fri Jan 29 17:49:06 2010
New Revision: 21528
Log:
Add no_repeat_mask option, so that single-pulse vectors can also be
expressed in a AMRFixed structure and handled by ff_set_fixed_vector().
Modified:
trunk/libavcodec/acelp_vectors.c
trunk/libavcodec/acelp_vectors.h
Modified: trunk/libavcodec/acelp_vectors.c
==============================================================================
--- trunk/libavcodec/acelp_vectors.c Fri Jan 29 14:51:25 2010 (r21527)
+++ trunk/libavcodec/acelp_vectors.c Fri Jan 29 17:49:06 2010 (r21528)
@@ -164,6 +164,7 @@ void ff_decode_10_pulses_35bits(const in
int i;
int mask = (1 << bits) - 1;
+ fixed_sparse->no_repeat_mask = 0;
fixed_sparse->n = 2 * half_pulse_count;
for (i = 0; i < half_pulse_count; i++) {
const int pos1 = gray_decode[fixed_index[2*i+1] & mask] + i;
@@ -243,14 +244,14 @@ void ff_set_fixed_vector(float *out, con
int i;
for (i=0; i < in->n; i++) {
- int x = in->x[i];
+ int x = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1);
float y = in->y[i] * scale;
do {
out[x] += y;
y *= in->pitch_fac;
x += in->pitch_lag;
- } while (x < size);
+ } while (x < size && repeats);
}
}
@@ -259,11 +260,11 @@ void ff_clear_fixed_vector(float *out, c
int i;
for (i=0; i < in->n; i++) {
- int x = in->x[i];
+ int x = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1);
do {
out[x] = 0.0;
x += in->pitch_lag;
- } while (x < size);
+ } while (x < size && repeats);
}
}
Modified: trunk/libavcodec/acelp_vectors.h
==============================================================================
--- trunk/libavcodec/acelp_vectors.h Fri Jan 29 14:51:25 2010 (r21527)
+++ trunk/libavcodec/acelp_vectors.h Fri Jan 29 17:49:06 2010 (r21528)
@@ -30,6 +30,7 @@ typedef struct {
int n;
int x[10];
float y[10];
+ int no_repeat_mask;
int pitch_lag;
float pitch_fac;
} AMRFixed;
More information about the ffmpeg-cvslog
mailing list