Mercurial > libavcodec.hg
comparison bitstream_filter.c @ 4364:05e932ddaaa9 libavcodec
rename BE/LE_8/16/32 to AV_RL/B_8/16/32
| author | alex |
|---|---|
| date | Fri, 19 Jan 2007 22:12:59 +0000 |
| parents | 38bb77e11353 |
| children | 3fa689636240 |
comparison
equal
deleted
inserted
replaced
| 4363:9b7662fa4905 | 4364:05e932ddaaa9 |
|---|---|
| 136 if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){ | 136 if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){ |
| 137 av_log(avctx, AV_LOG_ERROR, "not standards compliant\n"); | 137 av_log(avctx, AV_LOG_ERROR, "not standards compliant\n"); |
| 138 return -1; | 138 return -1; |
| 139 } | 139 } |
| 140 | 140 |
| 141 header = BE_32(buf); | 141 header = AV_RB32(buf); |
| 142 mode_extension= (header>>4)&3; | 142 mode_extension= (header>>4)&3; |
| 143 | 143 |
| 144 if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){ | 144 if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){ |
| 145 output_unchanged: | 145 output_unchanged: |
| 146 *poutbuf= (uint8_t *) buf; | 146 *poutbuf= (uint8_t *) buf; |
| 158 } | 158 } |
| 159 if(avctx->extradata_size != 15){ | 159 if(avctx->extradata_size != 15){ |
| 160 av_log(avctx, AV_LOG_ERROR, "Extradata invalid\n"); | 160 av_log(avctx, AV_LOG_ERROR, "Extradata invalid\n"); |
| 161 return -1; | 161 return -1; |
| 162 } | 162 } |
| 163 extraheader = BE_32(avctx->extradata+11); | 163 extraheader = AV_RB32(avctx->extradata+11); |
| 164 if((extraheader&MP3_MASK) != (header&MP3_MASK)) | 164 if((extraheader&MP3_MASK) != (header&MP3_MASK)) |
| 165 goto output_unchanged; | 165 goto output_unchanged; |
| 166 | 166 |
| 167 header_size= (header&0x10000) ? 4 : 6; | 167 header_size= (header&0x10000) ? 4 : 6; |
| 168 | 168 |
| 190 uint32_t header; | 190 uint32_t header; |
| 191 int sample_rate= avctx->sample_rate; | 191 int sample_rate= avctx->sample_rate; |
| 192 int sample_rate_index=0; | 192 int sample_rate_index=0; |
| 193 int lsf, mpeg25, bitrate_index, frame_size; | 193 int lsf, mpeg25, bitrate_index, frame_size; |
| 194 | 194 |
| 195 header = BE_32(buf); | 195 header = AV_RB32(buf); |
| 196 if(ff_mpa_check_header(header) >= 0){ | 196 if(ff_mpa_check_header(header) >= 0){ |
| 197 *poutbuf= (uint8_t *) buf; | 197 *poutbuf= (uint8_t *) buf; |
| 198 *poutbuf_size= buf_size; | 198 *poutbuf_size= buf_size; |
| 199 | 199 |
| 200 return 0; | 200 return 0; |
| 203 if(avctx->extradata_size != 15 || strcmp(avctx->extradata, "FFCMP3 0.0")){ | 203 if(avctx->extradata_size != 15 || strcmp(avctx->extradata, "FFCMP3 0.0")){ |
| 204 av_log(avctx, AV_LOG_ERROR, "Extradata invalid %d\n", avctx->extradata_size); | 204 av_log(avctx, AV_LOG_ERROR, "Extradata invalid %d\n", avctx->extradata_size); |
| 205 return -1; | 205 return -1; |
| 206 } | 206 } |
| 207 | 207 |
| 208 header= BE_32(avctx->extradata+11) & MP3_MASK; | 208 header= AV_RB32(avctx->extradata+11) & MP3_MASK; |
| 209 | 209 |
| 210 lsf = sample_rate < (24000+32000)/2; | 210 lsf = sample_rate < (24000+32000)/2; |
| 211 mpeg25 = sample_rate < (12000+16000)/2; | 211 mpeg25 = sample_rate < (12000+16000)/2; |
| 212 sample_rate_index= (header>>10)&3; | 212 sample_rate_index= (header>>10)&3; |
| 213 sample_rate= mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25); //in case sample rate is a little off | 213 sample_rate= mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25); //in case sample rate is a little off |
