X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcook.c;h=f487db6a975b41ceb08f91f2dc55b16dcef791a8;hb=f450cc7bc595155bacdb9f5d2414a076ccf81b4a;hp=8c2fab7a27ab2255bd8c7851f677aa380a7d697a;hpb=299d8ab104fb350254eb2e6d9ecdce892a2a55b1;p=ffmpeg diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 8c2fab7a27a..f487db6a975 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -64,12 +64,12 @@ #define SUBBAND_SIZE 20 #define MAX_SUBPACKETS 5 -typedef struct { +typedef struct cook_gains { int *now; int *previous; } cook_gains; -typedef struct { +typedef struct COOKSubpacket { int ch_idx; int size; int num_channels; @@ -140,7 +140,7 @@ typedef struct cook { VLC envelope_quant_index[13]; VLC sqvh[7]; // scalar quantization - /* generatable tables and related variables */ + /* generate tables and related variables */ int gain_size_factor; float gain_table[23]; @@ -1013,14 +1013,14 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data, static void dump_cook_context(COOKContext *q) { //int i=0; -#define PRINT(a, b) av_dlog(q->avctx, " %s = %d\n", a, b); - av_dlog(q->avctx, "COOKextradata\n"); - av_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion); +#define PRINT(a, b) ff_dlog(q->avctx, " %s = %d\n", a, b); + ff_dlog(q->avctx, "COOKextradata\n"); + ff_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion); if (q->subpacket[0].cookversion > STEREO) { PRINT("js_subband_start", q->subpacket[0].js_subband_start); PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits); } - av_dlog(q->avctx, "COOKContext\n"); + ff_dlog(q->avctx, "COOKContext\n"); PRINT("nb_channels", q->avctx->channels); PRINT("bit_rate", q->avctx->bit_rate); PRINT("sample_rate", q->avctx->sample_rate); @@ -1170,7 +1170,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) /* Initialize variable relations */ q->subpacket[s].numvector_size = (1 << q->subpacket[s].log2_numvector_size); - /* Try to catch some obviously faulty streams, othervise it might be exploitable */ + /* Try to catch some obviously faulty streams, otherwise it might be exploitable */ if (q->subpacket[s].total_subbands > 53) { avpriv_request_sample(avctx, "total_subbands > 53"); return AVERROR_PATCHWELCOME; @@ -1213,11 +1213,11 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) /* Pad the databuffer with: DECODE_BYTES_PAD1 or DECODE_BYTES_PAD2 for decode_bytes(), - FF_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */ + AV_INPUT_BUFFER_PADDING_SIZE, for the bitstreamreader. */ q->decoded_bytes_buffer = av_mallocz(avctx->block_align + DECODE_BYTES_PAD1(avctx->block_align) - + FF_INPUT_BUFFER_PADDING_SIZE); + + AV_INPUT_BUFFER_PADDING_SIZE); if (!q->decoded_bytes_buffer) return AVERROR(ENOMEM); @@ -1234,7 +1234,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q->saturate_output = saturate_output_float; } - /* Try to catch some obviously faulty streams, othervise it might be exploitable */ + /* Try to catch some obviously faulty streams, otherwise it might be exploitable */ if (q->samples_per_channel != 256 && q->samples_per_channel != 512 && q->samples_per_channel != 1024) { avpriv_request_sample(avctx, "samples_per_channel = %d", @@ -1263,7 +1263,7 @@ AVCodec ff_cook_decoder = { .init = cook_decode_init, .close = cook_decode_close, .decode = cook_decode_frame, - .capabilities = CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, };