MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / decode_envelope

Function decode_envelope

libavcodec/cook.c:395–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393 */
394
395static void decode_envelope(COOKContext *q, COOKSubpacket *p, int* quant_index_table) {
396 int i,j, vlc_index;
397
398 quant_index_table[0]= get_bits(&q->gb,6) - 6; //This is used later in categorize
399
400 for (i=1 ; i < p->total_subbands ; i++){
401 vlc_index=i;
402 if (i >= p->js_subband_start * 2) {
403 vlc_index-=p->js_subband_start;
404 } else {
405 vlc_index/=2;
406 if(vlc_index < 1) vlc_index = 1;
407 }
408 if (vlc_index>13) vlc_index = 13; //the VLC tables >13 are identical to No. 13
409
410 j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index-1].table,
411 q->envelope_quant_index[vlc_index-1].bits,2);
412 quant_index_table[i] = quant_index_table[i-1] + j - 12; //differential encoding
413 }
414}
415
416/**
417 * Calculate the category and category_index vector.

Callers 1

mono_decodeFunction · 0.85

Calls 2

get_bitsFunction · 0.85
get_vlc2Function · 0.85

Tested by

no test coverage detected