Mercurial > libavcodec.hg
comparison liba52/parse.c @ 1018:696ccd81403e libavcodec
reverse
| author | nickols_k |
|---|---|
| date | Mon, 20 Jan 2003 18:43:31 +0000 |
| parents | e113a950c074 |
| children | 68d0a38bd802 |
comparison
equal
deleted
inserted
replaced
| 1017:e113a950c074 | 1018:696ccd81403e |
|---|---|
| 43 int q4_ptr; | 43 int q4_ptr; |
| 44 } quantizer_t; | 44 } quantizer_t; |
| 45 | 45 |
| 46 static uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}; | 46 static uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}; |
| 47 | 47 |
| 48 a52_state_t * ff_a52_init (uint32_t mm_accel) | 48 a52_state_t * a52_init (uint32_t mm_accel) |
| 49 { | 49 { |
| 50 a52_state_t * state; | 50 a52_state_t * state; |
| 51 int i; | 51 int i; |
| 52 | 52 |
| 53 state = malloc (sizeof (a52_state_t)); | 53 state = malloc (sizeof (a52_state_t)); |
| 68 a52_imdct_init (mm_accel); | 68 a52_imdct_init (mm_accel); |
| 69 | 69 |
| 70 return state; | 70 return state; |
| 71 } | 71 } |
| 72 | 72 |
| 73 sample_t * ff_a52_samples (a52_state_t * state) | 73 sample_t * a52_samples (a52_state_t * state) |
| 74 { | 74 { |
| 75 return state->samples; | 75 return state->samples; |
| 76 } | 76 } |
| 77 | 77 |
| 78 int ff_a52_syncinfo (uint8_t * buf, int * flags, | 78 int a52_syncinfo (uint8_t * buf, int * flags, |
| 79 int * sample_rate, int * bit_rate) | 79 int * sample_rate, int * bit_rate) |
| 80 { | 80 { |
| 81 static int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112, | 81 static int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112, |
| 82 128, 160, 192, 224, 256, 320, 384, 448, | 82 128, 160, 192, 224, 256, 320, 384, 448, |
| 83 512, 576, 640}; | 83 512, 576, 640}; |
| 118 default: | 118 default: |
| 119 return 0; | 119 return 0; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 int ff_a52_frame (a52_state_t * state, uint8_t * buf, int * flags, | 123 int a52_frame (a52_state_t * state, uint8_t * buf, int * flags, |
| 124 sample_t * level, sample_t bias) | 124 sample_t * level, sample_t bias) |
| 125 { | 125 { |
| 126 static sample_t clev[4] = {LEVEL_3DB, LEVEL_45DB, LEVEL_6DB, LEVEL_45DB}; | 126 static sample_t clev[4] = {LEVEL_3DB, LEVEL_45DB, LEVEL_6DB, LEVEL_45DB}; |
| 127 static sample_t slev[4] = {LEVEL_3DB, LEVEL_6DB, 0, LEVEL_6DB}; | 127 static sample_t slev[4] = {LEVEL_3DB, LEVEL_6DB, 0, LEVEL_6DB}; |
| 128 int chaninfo; | 128 int chaninfo; |
| 190 } | 190 } |
| 191 | 191 |
| 192 return 0; | 192 return 0; |
| 193 } | 193 } |
| 194 | 194 |
| 195 void ff_a52_dynrng (a52_state_t * state, | 195 void a52_dynrng (a52_state_t * state, |
| 196 sample_t (* call) (sample_t, void *), void * data) | 196 sample_t (* call) (sample_t, void *), void * data) |
| 197 { | 197 { |
| 198 state->dynrnge = 0; | 198 state->dynrnge = 0; |
| 199 if (call) { | 199 if (call) { |
| 200 state->dynrnge = 1; | 200 state->dynrnge = 1; |
| 510 i++; | 510 i++; |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 | 514 |
| 515 int ff_a52_block (a52_state_t * state) | 515 int a52_block (a52_state_t * state) |
| 516 { | 516 { |
| 517 static const uint8_t nfchans_tbl[] = {2, 1, 2, 3, 3, 4, 4, 5, 1, 1, 2}; | 517 static const uint8_t nfchans_tbl[] = {2, 1, 2, 3, 3, 4, 4, 5, 1, 1, 2}; |
| 518 static int rematrix_band[4] = {25, 37, 61, 253}; | 518 static int rematrix_band[4] = {25, 37, 61, 253}; |
| 519 int i, nfchans, chaninfo; | 519 int i, nfchans, chaninfo; |
| 520 uint8_t cplexpstr, chexpstr[5], lfeexpstr, do_bit_alloc, done_cpl; | 520 uint8_t cplexpstr, chexpstr[5], lfeexpstr, do_bit_alloc, done_cpl; |
| 885 } | 885 } |
| 886 | 886 |
| 887 return 0; | 887 return 0; |
| 888 } | 888 } |
| 889 | 889 |
| 890 void ff_a52_free (a52_state_t * state) | 890 void a52_free (a52_state_t * state) |
| 891 { | 891 { |
| 892 free (state->samples); | 892 free (state->samples); |
| 893 free (state); | 893 free (state); |
| 894 } | 894 } |
