summaryrefslogtreecommitdiff
path: root/libavcodec/g729dec.c
diff options
context:
space:
mode:
authorVladimir Voroshilov <voroshil@gmail.com>2009-06-13 00:24:23 +0700
committerMichael Niedermayer <michaelni@gmx.at>2011-09-24 21:11:00 +0200
commit70efd101f102168d928b394f1e46f555c82afad9 (patch)
tree12617ac13e5a356428dac186b691ea37e1759c99 /libavcodec/g729dec.c
parent50cad2562522142f15ef0370df07939652c9feb3 (diff)
downloadffmpeg-70efd101f102168d928b394f1e46f555c82afad9.tar.gz
Add packet_type
Diffstat (limited to 'libavcodec/g729dec.c')
-rw-r--r--libavcodec/g729dec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 1e29a7e9a2..9826e63e49 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -71,6 +71,12 @@
*/
#define SHARP_MAX 13017
+typedef enum {
+ FORMAT_G729_8K = 0,
+ FORMAT_G729D_6K4,
+ FORMAT_COUNT,
+} G729Formats;
+
typedef struct {
uint8_t ac_index_bits[2]; ///< adaptive codebook index for second subframe (size in bits)
uint8_t parity_bit; ///< parity bit for pitch delay
@@ -233,6 +239,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int bad_pitch = 0; ///< parity check failed
int i;
int16_t *tmp;
+ G729Formats packet_type;
G729Context *ctx = avctx->priv_data;
int16_t lp[2][11]; // (3.12)
uint8_t ma_predictor; ///< switched MA predictor of LSP quantizer
@@ -249,9 +256,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
if (buf_size == 10) {
+ packet_type = FORMAT_G729_8K;
format = format_g729_8k;
av_log(avctx, AV_LOG_DEBUG, "Packet type: %s\n", "G.729 @ 8kbit/s");
} else if (buf_size == 8) {
+ packet_type = FORMAT_G729D_6K4;
format = format_g729d_6k4;
av_log(avctx, AV_LOG_DEBUG, "Packet type: %s\n", "G.729D @ 6.4kbit/s");
} else {