summaryrefslogtreecommitdiff
path: root/libavcodec/g722enc.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-12-02 01:08:35 +0200
committerMartin Storsjö <martin@martin.st>2011-12-05 12:41:46 +0200
commitf32fd31858116fbecaffe9559e0a4ad2725f6018 (patch)
tree37e50b13768fad14a163330335df00f327439d61 /libavcodec/g722enc.c
parent6fcbb0f553b8e45993e2746d3763adc2faec0781 (diff)
g722: Change bits per sample to 4
Earlier, bits per sample was defined as 8, since bits_per_coded_sample was used to indicate whether to ignore the lower bits of the codeword, having values 6, 7 or 8. g722 encodes 2 samples into one byte codeword, therefore the bits per sample is 4. By changing this, the generated timestamps for streams encoded with g722 become correct. This makes timestamp generation for g722 data correct (both when encoding and when demuxing from raw g722 files). Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/g722enc.c')
-rw-r--r--libavcodec/g722enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c
index bdc30d5d07..f8db49aba8 100644
--- a/libavcodec/g722enc.c
+++ b/libavcodec/g722enc.c
@@ -139,7 +139,7 @@ static int g722_encode_trellis(AVCodecContext *avctx,
nodes[i][0]->state = c->band[i];
}
- for (i = 0; i < buf_size >> 1; i++) {
+ for (i = 0; i < buf_size; i++) {
int xlow, xhigh;
struct TrellisNode *next[2];
int heap_pos[2] = {0, 0};
@@ -285,7 +285,7 @@ static int g722_encode_frame(AVCodecContext *avctx,
if (avctx->trellis)
return g722_encode_trellis(avctx, dst, buf_size, data);
- for (i = 0; i < buf_size >> 1; i++) {
+ for (i = 0; i < buf_size; i++) {
int xlow, xhigh, ihigh, ilow;
filter_samples(c, &samples[2*i], &xlow, &xhigh);
ihigh = encode_high(&c->band[1], xhigh);