Originally committed as revision 15262 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -160,7 +160,7 @@ static av_cold int decode_init(AVCodecContext *avctx) |
| 160 | 160 |
return 1; |
| 161 | 161 |
} |
| 162 | 162 |
|
| 163 |
- switch (avctx->bits_per_sample) {
|
|
| 163 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 164 | 164 |
case 8: |
| 165 | 165 |
avctx->pix_fmt = PIX_FMT_PAL8; |
| 166 | 166 |
c->planes = 1; |
| ... | ... |
@@ -193,7 +193,7 @@ static av_cold int decode_init(AVCodecContext *avctx) |
| 193 | 193 |
#endif |
| 194 | 194 |
break; |
| 195 | 195 |
default: |
| 196 |
- av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", avctx->bits_per_sample); |
|
| 196 |
+ av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", avctx->bits_per_coded_sample); |
|
| 197 | 197 |
return -1; |
| 198 | 198 |
} |
| 199 | 199 |
|
| ... | ... |
@@ -597,7 +597,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx) |
| 597 | 597 |
alac->context_initialized = 0; |
| 598 | 598 |
|
| 599 | 599 |
alac->numchannels = alac->avctx->channels; |
| 600 |
- alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels; |
|
| 600 |
+ alac->bytespersample = (avctx->bits_per_coded_sample / 8) * alac->numchannels; |
|
| 601 | 601 |
avctx->sample_fmt = SAMPLE_FMT_S16; |
| 602 | 602 |
|
| 603 | 603 |
return 0; |
| ... | ... |
@@ -364,7 +364,7 @@ static av_cold int alac_encode_init(AVCodecContext *avctx) |
| 364 | 364 |
uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1); |
| 365 | 365 |
|
| 366 | 366 |
avctx->frame_size = DEFAULT_FRAME_SIZE; |
| 367 |
- avctx->bits_per_sample = DEFAULT_SAMPLE_SIZE; |
|
| 367 |
+ avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE; |
|
| 368 | 368 |
|
| 369 | 369 |
if(avctx->sample_fmt != SAMPLE_FMT_S16) {
|
| 370 | 370 |
av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n"); |
| ... | ... |
@@ -384,17 +384,17 @@ static av_cold int alac_encode_init(AVCodecContext *avctx) |
| 384 | 384 |
s->rc.rice_modifier = 4; |
| 385 | 385 |
|
| 386 | 386 |
s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE + |
| 387 |
- avctx->frame_size*avctx->channels*avctx->bits_per_sample)>>3; |
|
| 387 |
+ avctx->frame_size*avctx->channels*avctx->bits_per_coded_sample)>>3; |
|
| 388 | 388 |
|
| 389 |
- s->write_sample_size = avctx->bits_per_sample + avctx->channels - 1; // FIXME: consider wasted_bytes |
|
| 389 |
+ s->write_sample_size = avctx->bits_per_coded_sample + avctx->channels - 1; // FIXME: consider wasted_bytes |
|
| 390 | 390 |
|
| 391 | 391 |
AV_WB32(alac_extradata, ALAC_EXTRADATA_SIZE); |
| 392 | 392 |
AV_WB32(alac_extradata+4, MKBETAG('a','l','a','c'));
|
| 393 | 393 |
AV_WB32(alac_extradata+12, avctx->frame_size); |
| 394 |
- AV_WB8 (alac_extradata+17, avctx->bits_per_sample); |
|
| 394 |
+ AV_WB8 (alac_extradata+17, avctx->bits_per_coded_sample); |
|
| 395 | 395 |
AV_WB8 (alac_extradata+21, avctx->channels); |
| 396 | 396 |
AV_WB32(alac_extradata+24, s->max_coded_frame_size); |
| 397 |
- AV_WB32(alac_extradata+28, avctx->sample_rate*avctx->channels*avctx->bits_per_sample); // average bitrate |
|
| 397 |
+ AV_WB32(alac_extradata+28, avctx->sample_rate*avctx->channels*avctx->bits_per_coded_sample); // average bitrate |
|
| 398 | 398 |
AV_WB32(alac_extradata+32, avctx->sample_rate); |
| 399 | 399 |
|
| 400 | 400 |
// Set relevant extradata fields |
| ... | ... |
@@ -171,7 +171,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx) |
| 171 | 171 |
av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); |
| 172 | 172 |
return -1; |
| 173 | 173 |
} |
| 174 |
- if (avctx->bits_per_sample != 16) {
|
|
| 174 |
+ if (avctx->bits_per_coded_sample != 16) {
|
|
| 175 | 175 |
av_log(avctx, AV_LOG_ERROR, "Only 16-bit samples are supported\n"); |
| 176 | 176 |
return -1; |
| 177 | 177 |
} |
| ... | ... |
@@ -29,8 +29,8 @@ |
| 29 | 29 |
|
| 30 | 30 |
#include "libavutil/avutil.h" |
| 31 | 31 |
|
| 32 |
-#define LIBAVCODEC_VERSION_MAJOR 51 |
|
| 33 |
-#define LIBAVCODEC_VERSION_MINOR 71 |
|
| 32 |
+#define LIBAVCODEC_VERSION_MAJOR 52 |
|
| 33 |
+#define LIBAVCODEC_VERSION_MINOR 0 |
|
| 34 | 34 |
#define LIBAVCODEC_VERSION_MICRO 0 |
| 35 | 35 |
|
| 36 | 36 |
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| ... | ... |
@@ -395,7 +395,7 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) |
| 395 | 395 |
s->sega_film_skip_bytes = -1; /* uninitialized state */ |
| 396 | 396 |
|
| 397 | 397 |
// check for paletted data |
| 398 |
- if ((avctx->palctrl == NULL) || (avctx->bits_per_sample == 40)) {
|
|
| 398 |
+ if ((avctx->palctrl == NULL) || (avctx->bits_per_coded_sample == 40)) {
|
|
| 399 | 399 |
s->palette_video = 0; |
| 400 | 400 |
avctx->pix_fmt = PIX_FMT_YUV420P; |
| 401 | 401 |
} else {
|
| ... | ... |
@@ -217,19 +217,19 @@ static av_cold int decode_init(AVCodecContext *avctx) {
|
| 217 | 217 |
if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
|
| 218 | 218 |
return 1; |
| 219 | 219 |
} |
| 220 |
- switch (avctx->bits_per_sample) {
|
|
| 220 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 221 | 221 |
case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; |
| 222 | 222 |
case 24: avctx->pix_fmt = PIX_FMT_BGR24; break; |
| 223 | 223 |
case 32: avctx->pix_fmt = PIX_FMT_RGB32; break; |
| 224 | 224 |
default: |
| 225 | 225 |
av_log(avctx, AV_LOG_ERROR, |
| 226 | 226 |
"CamStudio codec error: invalid depth %i bpp\n", |
| 227 |
- avctx->bits_per_sample); |
|
| 227 |
+ avctx->bits_per_coded_sample); |
|
| 228 | 228 |
return 1; |
| 229 | 229 |
} |
| 230 |
- c->bpp = avctx->bits_per_sample; |
|
| 230 |
+ c->bpp = avctx->bits_per_coded_sample; |
|
| 231 | 231 |
c->pic.data[0] = NULL; |
| 232 |
- c->linelen = avctx->width * avctx->bits_per_sample / 8; |
|
| 232 |
+ c->linelen = avctx->width * avctx->bits_per_coded_sample / 8; |
|
| 233 | 233 |
c->height = avctx->height; |
| 234 | 234 |
c->decomp_size = c->height * c->linelen; |
| 235 | 235 |
c->decomp_buf = av_malloc(c->decomp_size + LZO_OUTPUT_PADDING); |
| ... | ... |
@@ -492,7 +492,7 @@ s->bgr32=1; |
| 492 | 492 |
//if(avctx->extradata) |
| 493 | 493 |
// printf("extradata:%X, extradata_size:%d\n", *(uint32_t*)avctx->extradata, avctx->extradata_size);
|
| 494 | 494 |
if(avctx->extradata_size){
|
| 495 |
- if((avctx->bits_per_sample&7) && avctx->bits_per_sample != 12) |
|
| 495 |
+ if((avctx->bits_per_coded_sample&7) && avctx->bits_per_coded_sample != 12) |
|
| 496 | 496 |
s->version=1; // do such files exist at all? |
| 497 | 497 |
else |
| 498 | 498 |
s->version=2; |
| ... | ... |
@@ -507,7 +507,7 @@ s->bgr32=1; |
| 507 | 507 |
s->predictor= method&63; |
| 508 | 508 |
s->bitstream_bpp= ((uint8_t*)avctx->extradata)[1]; |
| 509 | 509 |
if(s->bitstream_bpp==0) |
| 510 |
- s->bitstream_bpp= avctx->bits_per_sample&~7; |
|
| 510 |
+ s->bitstream_bpp= avctx->bits_per_coded_sample&~7; |
|
| 511 | 511 |
interlace= (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4; |
| 512 | 512 |
s->interlaced= (interlace==1) ? 1 : (interlace==2) ? 0 : s->interlaced; |
| 513 | 513 |
s->context= ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0; |
| ... | ... |
@@ -515,7 +515,7 @@ s->bgr32=1; |
| 515 | 515 |
if(read_huffman_tables(s, ((uint8_t*)avctx->extradata)+4, avctx->extradata_size) < 0) |
| 516 | 516 |
return -1; |
| 517 | 517 |
}else{
|
| 518 |
- switch(avctx->bits_per_sample&7){
|
|
| 518 |
+ switch(avctx->bits_per_coded_sample&7){
|
|
| 519 | 519 |
case 1: |
| 520 | 520 |
s->predictor= LEFT; |
| 521 | 521 |
s->decorrelate= 0; |
| ... | ... |
@@ -526,7 +526,7 @@ s->bgr32=1; |
| 526 | 526 |
break; |
| 527 | 527 |
case 3: |
| 528 | 528 |
s->predictor= PLANE; |
| 529 |
- s->decorrelate= avctx->bits_per_sample >= 24; |
|
| 529 |
+ s->decorrelate= avctx->bits_per_coded_sample >= 24; |
|
| 530 | 530 |
break; |
| 531 | 531 |
case 4: |
| 532 | 532 |
s->predictor= MEDIAN; |
| ... | ... |
@@ -537,7 +537,7 @@ s->bgr32=1; |
| 537 | 537 |
s->decorrelate= 0; |
| 538 | 538 |
break; |
| 539 | 539 |
} |
| 540 |
- s->bitstream_bpp= avctx->bits_per_sample & ~7; |
|
| 540 |
+ s->bitstream_bpp= avctx->bits_per_coded_sample & ~7; |
|
| 541 | 541 |
s->context= 0; |
| 542 | 542 |
|
| 543 | 543 |
if(read_old_huffman_tables(s) < 0) |
| ... | ... |
@@ -569,7 +569,7 @@ s->bgr32=1; |
| 569 | 569 |
|
| 570 | 570 |
alloc_temp(s); |
| 571 | 571 |
|
| 572 |
-// av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced); |
|
| 572 |
+// av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_coded_sample, s->interlaced); |
|
| 573 | 573 |
|
| 574 | 574 |
return 0; |
| 575 | 575 |
} |
| ... | ... |
@@ -626,7 +626,7 @@ static av_cold int encode_init(AVCodecContext *avctx) |
| 626 | 626 |
av_log(avctx, AV_LOG_ERROR, "format not supported\n"); |
| 627 | 627 |
return -1; |
| 628 | 628 |
} |
| 629 |
- avctx->bits_per_sample= s->bitstream_bpp; |
|
| 629 |
+ avctx->bits_per_coded_sample= s->bitstream_bpp; |
|
| 630 | 630 |
s->decorrelate= s->bitstream_bpp >= 24; |
| 631 | 631 |
s->predictor= avctx->prediction_method; |
| 632 | 632 |
s->interlaced= avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0; |
| ... | ... |
@@ -717,7 +717,7 @@ static av_cold int encode_init(AVCodecContext *avctx) |
| 717 | 717 |
s->stats[i][j]= 0; |
| 718 | 718 |
} |
| 719 | 719 |
|
| 720 |
-// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
|
|
| 720 |
+// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_coded_sample, s->interlaced);
|
|
| 721 | 721 |
|
| 722 | 722 |
alloc_temp(s); |
| 723 | 723 |
|
| ... | ... |
@@ -53,7 +53,7 @@ struct SwsContext {
|
| 53 | 53 |
enum PixelFormat src_pix_fmt, dst_pix_fmt; |
| 54 | 54 |
}; |
| 55 | 55 |
|
| 56 |
-struct ImgReSampleContext {
|
|
| 56 |
+typedef struct ImgReSampleContext {
|
|
| 57 | 57 |
int iwidth, iheight, owidth, oheight; |
| 58 | 58 |
int topBand, bottomBand, leftBand, rightBand; |
| 59 | 59 |
int padtop, padbottom, padleft, padright; |
| ... | ... |
@@ -62,7 +62,7 @@ struct ImgReSampleContext {
|
| 62 | 62 |
DECLARE_ALIGNED_8(int16_t, h_filters[NB_PHASES][NB_TAPS]); /* horizontal filters */ |
| 63 | 63 |
DECLARE_ALIGNED_8(int16_t, v_filters[NB_PHASES][NB_TAPS]); /* vertical filters */ |
| 64 | 64 |
uint8_t *line_buf; |
| 65 |
-}; |
|
| 65 |
+} ImgReSampleContext; |
|
| 66 | 66 |
|
| 67 | 67 |
void av_build_filter(int16_t *filter, double factor, int tap_count, int phase_count, int scale, int type); |
| 68 | 68 |
|
| ... | ... |
@@ -424,13 +424,6 @@ static void component_resample(ImgReSampleContext *s, |
| 424 | 424 |
} |
| 425 | 425 |
} |
| 426 | 426 |
|
| 427 |
-ImgReSampleContext *img_resample_init(int owidth, int oheight, |
|
| 428 |
- int iwidth, int iheight) |
|
| 429 |
-{
|
|
| 430 |
- return img_resample_full_init(owidth, oheight, iwidth, iheight, |
|
| 431 |
- 0, 0, 0, 0, 0, 0, 0, 0); |
|
| 432 |
-} |
|
| 433 |
- |
|
| 434 | 427 |
ImgReSampleContext *img_resample_full_init(int owidth, int oheight, |
| 435 | 428 |
int iwidth, int iheight, |
| 436 | 429 |
int topBand, int bottomBand, |
| ... | ... |
@@ -484,6 +477,13 @@ fail: |
| 484 | 484 |
return NULL; |
| 485 | 485 |
} |
| 486 | 486 |
|
| 487 |
+ImgReSampleContext *img_resample_init(int owidth, int oheight, |
|
| 488 |
+ int iwidth, int iheight) |
|
| 489 |
+{
|
|
| 490 |
+ return img_resample_full_init(owidth, oheight, iwidth, iheight, |
|
| 491 |
+ 0, 0, 0, 0, 0, 0, 0, 0); |
|
| 492 |
+} |
|
| 493 |
+ |
|
| 487 | 494 |
void img_resample(ImgReSampleContext *s, |
| 488 | 495 |
AVPicture *output, const AVPicture *input) |
| 489 | 496 |
{
|
| ... | ... |
@@ -164,7 +164,7 @@ static av_cold int encode_init(AVCodecContext *avctx) |
| 164 | 164 |
case PIX_FMT_BGR24: |
| 165 | 165 |
c->imgtype = IMGTYPE_RGB24; |
| 166 | 166 |
c->decomp_size = avctx->width * avctx->height * 3; |
| 167 |
- avctx->bits_per_sample= 24; |
|
| 167 |
+ avctx->bits_per_coded_sample= 24; |
|
| 168 | 168 |
break; |
| 169 | 169 |
default: |
| 170 | 170 |
av_log(avctx, AV_LOG_ERROR, "Input pixel format %s not supported\n", avcodec_get_pix_fmt_name(avctx->pix_fmt)); |
| ... | ... |
@@ -279,8 +279,8 @@ static av_cold int faac_decode_init(AVCodecContext *avctx) |
| 279 | 279 |
faac_cfg = s->faacDecGetCurrentConfiguration(s->faac_handle); |
| 280 | 280 |
|
| 281 | 281 |
if (faac_cfg) {
|
| 282 |
- switch (avctx->bits_per_sample) {
|
|
| 283 |
- case 8: av_log(avctx, AV_LOG_ERROR, "FAADlib unsupported bps %d\n", avctx->bits_per_sample); break; |
|
| 282 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 283 |
+ case 8: av_log(avctx, AV_LOG_ERROR, "FAADlib unsupported bps %d\n", avctx->bits_per_coded_sample); break; |
|
| 284 | 284 |
default: |
| 285 | 285 |
case 16: |
| 286 | 286 |
#ifdef FAAD2_VERSION |
| ... | ... |
@@ -264,7 +264,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, |
| 264 | 264 |
return -1; |
| 265 | 265 |
} |
| 266 | 266 |
|
| 267 |
- switch (avctx->bits_per_sample) {
|
|
| 267 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 268 | 268 |
case 8: |
| 269 | 269 |
msrle_decode_pal8(s); |
| 270 | 270 |
break; |
| ... | ... |
@@ -273,7 +273,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, |
| 273 | 273 |
break; |
| 274 | 274 |
default: |
| 275 | 275 |
av_log(avctx, AV_LOG_ERROR, "Don't know how to decode depth %u.\n", |
| 276 |
- avctx->bits_per_sample); |
|
| 276 |
+ avctx->bits_per_coded_sample); |
|
| 277 | 277 |
} |
| 278 | 278 |
|
| 279 | 279 |
*data_size = sizeof(AVFrame); |
| ... | ... |
@@ -118,8 +118,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx) |
| 118 | 118 |
break; |
| 119 | 119 |
} |
| 120 | 120 |
|
| 121 |
- avctx->bits_per_sample = av_get_bits_per_sample(avctx->codec->id); |
|
| 122 |
- avctx->block_align = avctx->channels * avctx->bits_per_sample/8; |
|
| 121 |
+ avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id); |
|
| 122 |
+ avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8; |
|
| 123 | 123 |
avctx->coded_frame= avcodec_alloc_frame(); |
| 124 | 124 |
avctx->coded_frame->key_frame= 1; |
| 125 | 125 |
|
| ... | ... |
@@ -354,7 +354,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, |
| 354 | 354 |
/* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */ |
| 355 | 355 |
if (CODEC_ID_PCM_DVD == avctx->codec_id) |
| 356 | 356 |
/* 2 samples are interleaved per block in PCM_DVD */ |
| 357 |
- sample_size = avctx->bits_per_sample * 2 / 8; |
|
| 357 |
+ sample_size = avctx->bits_per_coded_sample * 2 / 8; |
|
| 358 | 358 |
|
| 359 | 359 |
n = avctx->channels * sample_size; |
| 360 | 360 |
|
| ... | ... |
@@ -470,7 +470,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, |
| 470 | 470 |
case CODEC_ID_PCM_DVD: |
| 471 | 471 |
dst_int32_t = data; |
| 472 | 472 |
n /= avctx->channels; |
| 473 |
- switch (avctx->bits_per_sample) {
|
|
| 473 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 474 | 474 |
case 20: |
| 475 | 475 |
while (n--) {
|
| 476 | 476 |
c = avctx->channels; |
| ... | ... |
@@ -383,7 +383,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) |
| 383 | 383 |
QtrleContext *s = avctx->priv_data; |
| 384 | 384 |
|
| 385 | 385 |
s->avctx = avctx; |
| 386 |
- switch (avctx->bits_per_sample) {
|
|
| 386 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 387 | 387 |
case 1: |
| 388 | 388 |
case 33: |
| 389 | 389 |
avctx->pix_fmt = PIX_FMT_MONOWHITE; |
| ... | ... |
@@ -412,7 +412,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) |
| 412 | 412 |
|
| 413 | 413 |
default: |
| 414 | 414 |
av_log (avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n", |
| 415 |
- avctx->bits_per_sample); |
|
| 415 |
+ avctx->bits_per_coded_sample); |
|
| 416 | 416 |
break; |
| 417 | 417 |
} |
| 418 | 418 |
|
| ... | ... |
@@ -466,7 +466,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, |
| 466 | 466 |
} |
| 467 | 467 |
row_ptr = s->frame.linesize[0] * start_line; |
| 468 | 468 |
|
| 469 |
- switch (avctx->bits_per_sample) {
|
|
| 469 |
+ switch (avctx->bits_per_coded_sample) {
|
|
| 470 | 470 |
case 1: |
| 471 | 471 |
case 33: |
| 472 | 472 |
qtrle_decode_1bpp(s, stream_ptr, row_ptr, height); |
| ... | ... |
@@ -504,7 +504,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, |
| 504 | 504 |
|
| 505 | 505 |
default: |
| 506 | 506 |
av_log (s->avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n", |
| 507 |
- avctx->bits_per_sample); |
|
| 507 |
+ avctx->bits_per_coded_sample); |
|
| 508 | 508 |
break; |
| 509 | 509 |
} |
| 510 | 510 |
|
| ... | ... |
@@ -78,7 +78,7 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx) |
| 78 | 78 |
av_log(avctx, AV_LOG_ERROR, "Unsupported colorspace.\n"); |
| 79 | 79 |
break; |
| 80 | 80 |
} |
| 81 |
- avctx->bits_per_sample = s->pixel_size*8; |
|
| 81 |
+ avctx->bits_per_coded_sample = s->pixel_size*8; |
|
| 82 | 82 |
|
| 83 | 83 |
s->rlecode_table = av_mallocz(s->avctx->width); |
| 84 | 84 |
s->skip_table = av_mallocz(s->avctx->width); |
| ... | ... |
@@ -69,11 +69,11 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) |
| 69 | 69 |
RawVideoContext *context = avctx->priv_data; |
| 70 | 70 |
|
| 71 | 71 |
if (avctx->codec_tag == MKTAG('r','a','w',' '))
|
| 72 |
- avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_sample); |
|
| 72 |
+ avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample); |
|
| 73 | 73 |
else if (avctx->codec_tag) |
| 74 | 74 |
avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag); |
| 75 |
- else if (avctx->bits_per_sample) |
|
| 76 |
- avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_sample); |
|
| 75 |
+ else if (avctx->bits_per_coded_sample) |
|
| 76 |
+ avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_coded_sample); |
|
| 77 | 77 |
|
| 78 | 78 |
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); |
| 79 | 79 |
context->buffer = av_malloc(context->length); |
| ... | ... |
@@ -89,7 +89,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) |
| 89 | 89 |
} |
| 90 | 90 |
|
| 91 | 91 |
static void flip(AVCodecContext *avctx, AVPicture * picture){
|
| 92 |
- if(!avctx->codec_tag && avctx->bits_per_sample && picture->linesize[2]==0){
|
|
| 92 |
+ if(!avctx->codec_tag && avctx->bits_per_coded_sample && picture->linesize[2]==0){
|
|
| 93 | 93 |
picture->data[0] += picture->linesize[0] * (avctx->height-1); |
| 94 | 94 |
picture->linesize[0] *= -1; |
| 95 | 95 |
} |
| ... | ... |
@@ -108,7 +108,7 @@ static int raw_decode(AVCodecContext *avctx, |
| 108 | 108 |
frame->top_field_first = avctx->coded_frame->top_field_first; |
| 109 | 109 |
|
| 110 | 110 |
//4bpp raw in avi and mov (yes this is ugly ...) |
| 111 |
- if(avctx->bits_per_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && |
|
| 111 |
+ if(avctx->bits_per_coded_sample == 4 && avctx->pix_fmt==PIX_FMT_PAL8 && |
|
| 112 | 112 |
(!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){
|
| 113 | 113 |
int i; |
| 114 | 114 |
for(i=256*2; i+1 < context->length>>1; i++){
|
| ... | ... |
@@ -228,9 +228,9 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header |
| 228 | 228 |
avctx->sample_rate = get_le32(&hb); |
| 229 | 229 |
avctx->bit_rate = get_le32(&hb) * 8; |
| 230 | 230 |
avctx->block_align = get_le16(&hb); |
| 231 |
- avctx->bits_per_sample = get_le16(&hb); |
|
| 231 |
+ avctx->bits_per_coded_sample = get_le16(&hb); |
|
| 232 | 232 |
|
| 233 |
- if (avctx->bits_per_sample != 16) {
|
|
| 233 |
+ if (avctx->bits_per_coded_sample != 16) {
|
|
| 234 | 234 |
av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n"); |
| 235 | 235 |
return -1; |
| 236 | 236 |
} |
| ... | ... |
@@ -274,17 +274,17 @@ static av_cold int decode_init(AVCodecContext *avctx) |
| 274 | 274 |
av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n"); |
| 275 | 275 |
return 1; |
| 276 | 276 |
#endif |
| 277 |
- switch(avctx->bits_per_sample){
|
|
| 277 |
+ switch(avctx->bits_per_coded_sample){
|
|
| 278 | 278 |
case 8: avctx->pix_fmt = PIX_FMT_PAL8; break; |
| 279 | 279 |
case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; |
| 280 | 280 |
case 24: |
| 281 | 281 |
avctx->pix_fmt = PIX_FMT_BGR24; |
| 282 | 282 |
break; |
| 283 | 283 |
case 32: avctx->pix_fmt = PIX_FMT_RGB32; break; |
| 284 |
- default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_sample); |
|
| 284 |
+ default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_coded_sample); |
|
| 285 | 285 |
return -1; |
| 286 | 286 |
} |
| 287 |
- c->bpp = avctx->bits_per_sample; |
|
| 287 |
+ c->bpp = avctx->bits_per_coded_sample; |
|
| 288 | 288 |
c->decomp_size = (avctx->width * c->bpp + (avctx->width + 254) / 255 + 2) * avctx->height + 2;//RLE in the 'best' case |
| 289 | 289 |
|
| 290 | 290 |
/* Allocate decompression buffer */ |
| ... | ... |
@@ -226,8 +226,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) |
| 226 | 226 |
} |
| 227 | 227 |
s->is_float = (s->flags == FORMAT_FLOAT); |
| 228 | 228 |
avctx->channels = s->channels = get_bits(&s->gb, 16); |
| 229 |
- avctx->bits_per_sample = get_bits(&s->gb, 16); |
|
| 230 |
- s->bps = (avctx->bits_per_sample + 7) / 8; |
|
| 229 |
+ avctx->bits_per_coded_sample = get_bits(&s->gb, 16); |
|
| 230 |
+ s->bps = (avctx->bits_per_coded_sample + 7) / 8; |
|
| 231 | 231 |
avctx->sample_rate = get_bits_long(&s->gb, 32); |
| 232 | 232 |
if(avctx->sample_rate > 1000000){ //prevent FRAME_TIME * avctx->sample_rate from overflowing and sanity check
|
| 233 | 233 |
av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n"); |
| ... | ... |
@@ -261,7 +261,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) |
| 261 | 261 |
(s->last_frame_length ? 1 : 0); |
| 262 | 262 |
|
| 263 | 263 |
av_log(s->avctx, AV_LOG_DEBUG, "flags: %x chans: %d bps: %d rate: %d block: %d\n", |
| 264 |
- s->flags, avctx->channels, avctx->bits_per_sample, avctx->sample_rate, |
|
| 264 |
+ s->flags, avctx->channels, avctx->bits_per_coded_sample, avctx->sample_rate, |
|
| 265 | 265 |
avctx->block_align); |
| 266 | 266 |
av_log(s->avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n", |
| 267 | 267 |
s->data_length, s->frame_length, s->last_frame_length, s->total_frames); |
| ... | ... |
@@ -544,7 +544,6 @@ static const AVOption options[]={
|
| 544 | 544 |
{"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
|
| 545 | 545 |
{"p_mask", "inter masking", OFFSET(p_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
|
| 546 | 546 |
{"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), FF_OPT_TYPE_FLOAT, 0, -FLT_MAX, FLT_MAX, V|E},
|
| 547 |
-{"unused", NULL, OFFSET(unused), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
|
|
| 548 | 547 |
{"idct", "select IDCT implementation", OFFSET(idct_algo), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, V|E|D, "idct"},
|
| 549 | 548 |
{"auto", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_AUTO, INT_MIN, INT_MAX, V|E|D, "idct"},
|
| 550 | 549 |
{"int", NULL, 0, FF_OPT_TYPE_CONST, FF_IDCT_INT, INT_MIN, INT_MAX, V|E|D, "idct"},
|
| ... | ... |
@@ -444,7 +444,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx) |
| 444 | 444 |
|
| 445 | 445 |
s->avctx = avctx; |
| 446 | 446 |
s->channels = avctx->channels; |
| 447 |
- s->bits = avctx->bits_per_sample; |
|
| 447 |
+ s->bits = avctx->bits_per_coded_sample; |
|
| 448 | 448 |
s->block_align = avctx->block_align; |
| 449 | 449 |
avctx->sample_fmt = SAMPLE_FMT_S16; |
| 450 | 450 |
|
| ... | ... |
@@ -469,7 +469,7 @@ static av_cold int decode_init(AVCodecContext *avctx) |
| 469 | 469 |
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
|
| 470 | 470 |
return 1; |
| 471 | 471 |
} |
| 472 |
- c->bpp = avctx->bits_per_sample; |
|
| 472 |
+ c->bpp = avctx->bits_per_coded_sample; |
|
| 473 | 473 |
c->bpp2 = c->bpp/8; |
| 474 | 474 |
|
| 475 | 475 |
switch(c->bpp){
|
| ... | ... |
@@ -603,7 +603,7 @@ static av_cold int decode_init(AVCodecContext *avctx) |
| 603 | 603 |
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
|
| 604 | 604 |
return 1; |
| 605 | 605 |
} |
| 606 |
- c->bpp = avctx->bits_per_sample; |
|
| 606 |
+ c->bpp = avctx->bits_per_coded_sample; |
|
| 607 | 607 |
|
| 608 | 608 |
// Needed if zlib unused or init aborted before inflateInit |
| 609 | 609 |
memset(&(c->zstream), 0, sizeof(z_stream)); |
| ... | ... |
@@ -193,13 +193,13 @@ static int fourxm_read_header(AVFormatContext *s, |
| 193 | 193 |
st->codec->codec_tag = 0; |
| 194 | 194 |
st->codec->channels = fourxm->tracks[current_track].channels; |
| 195 | 195 |
st->codec->sample_rate = fourxm->tracks[current_track].sample_rate; |
| 196 |
- st->codec->bits_per_sample = fourxm->tracks[current_track].bits; |
|
| 196 |
+ st->codec->bits_per_coded_sample = fourxm->tracks[current_track].bits; |
|
| 197 | 197 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 198 |
- st->codec->bits_per_sample; |
|
| 199 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 198 |
+ st->codec->bits_per_coded_sample; |
|
| 199 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 200 | 200 |
if (fourxm->tracks[current_track].adpcm) |
| 201 | 201 |
st->codec->codec_id = CODEC_ID_ADPCM_4XM; |
| 202 |
- else if (st->codec->bits_per_sample == 8) |
|
| 202 |
+ else if (st->codec->bits_per_coded_sample == 8) |
|
| 203 | 203 |
st->codec->codec_id = CODEC_ID_PCM_U8; |
| 204 | 204 |
else |
| 205 | 205 |
st->codec->codec_id = CODEC_ID_PCM_S16LE; |
| ... | ... |
@@ -112,7 +112,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, |
| 112 | 112 |
codec->codec_type = CODEC_TYPE_AUDIO; |
| 113 | 113 |
codec->channels = get_be16(pb); |
| 114 | 114 |
num_frames = get_be32(pb); |
| 115 |
- codec->bits_per_sample = get_be16(pb); |
|
| 115 |
+ codec->bits_per_coded_sample = get_be16(pb); |
|
| 116 | 116 |
|
| 117 | 117 |
get_buffer(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */ |
| 118 | 118 |
sample_rate = av_ext2dbl(ext); /* 80 bits BE IEEE extended float */ |
| ... | ... |
@@ -126,8 +126,8 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, |
| 126 | 126 |
|
| 127 | 127 |
switch (codec->codec_id) {
|
| 128 | 128 |
case CODEC_ID_PCM_S16BE: |
| 129 |
- codec->codec_id = aiff_codec_get_id(codec->bits_per_sample); |
|
| 130 |
- codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id); |
|
| 129 |
+ codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); |
|
| 130 |
+ codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); |
|
| 131 | 131 |
break; |
| 132 | 132 |
case CODEC_ID_ADPCM_IMA_QT: |
| 133 | 133 |
codec->block_align = 34*codec->channels; |
| ... | ... |
@@ -151,14 +151,14 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, |
| 151 | 151 |
size -= 4; |
| 152 | 152 |
} else {
|
| 153 | 153 |
/* Need the codec type */ |
| 154 |
- codec->codec_id = aiff_codec_get_id(codec->bits_per_sample); |
|
| 155 |
- codec->bits_per_sample = av_get_bits_per_sample(codec->codec_id); |
|
| 154 |
+ codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); |
|
| 155 |
+ codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); |
|
| 156 | 156 |
} |
| 157 | 157 |
|
| 158 | 158 |
/* Block align needs to be computed in all cases, as the definition |
| 159 | 159 |
* is specific to applications -> here we use the WAVE format definition */ |
| 160 | 160 |
if (!codec->block_align) |
| 161 |
- codec->block_align = (codec->bits_per_sample * codec->channels) >> 3; |
|
| 161 |
+ codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3; |
|
| 162 | 162 |
|
| 163 | 163 |
codec->bit_rate = (codec->frame_size ? codec->sample_rate/codec->frame_size : |
| 164 | 164 |
codec->sample_rate) * (codec->block_align << 3); |
| ... | ... |
@@ -198,7 +198,7 @@ static int aiff_write_header(AVFormatContext *s) |
| 198 | 198 |
put_tag(pb, aifc ? "AIFC" : "AIFF"); |
| 199 | 199 |
|
| 200 | 200 |
if (aifc) { // compressed audio
|
| 201 |
- enc->bits_per_sample = 16; |
|
| 201 |
+ enc->bits_per_coded_sample = 16; |
|
| 202 | 202 |
if (!enc->block_align) {
|
| 203 | 203 |
av_log(s, AV_LOG_ERROR, "block align not set\n"); |
| 204 | 204 |
return -1; |
| ... | ... |
@@ -217,16 +217,16 @@ static int aiff_write_header(AVFormatContext *s) |
| 217 | 217 |
aiff->frames = url_ftell(pb); |
| 218 | 218 |
put_be32(pb, 0); /* Number of frames */ |
| 219 | 219 |
|
| 220 |
- if (!enc->bits_per_sample) |
|
| 221 |
- enc->bits_per_sample = av_get_bits_per_sample(enc->codec_id); |
|
| 222 |
- if (!enc->bits_per_sample) {
|
|
| 220 |
+ if (!enc->bits_per_coded_sample) |
|
| 221 |
+ enc->bits_per_coded_sample = av_get_bits_per_sample(enc->codec_id); |
|
| 222 |
+ if (!enc->bits_per_coded_sample) {
|
|
| 223 | 223 |
av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n"); |
| 224 | 224 |
return -1; |
| 225 | 225 |
} |
| 226 | 226 |
if (!enc->block_align) |
| 227 |
- enc->block_align = (enc->bits_per_sample * enc->channels) >> 3; |
|
| 227 |
+ enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3; |
|
| 228 | 228 |
|
| 229 |
- put_be16(pb, enc->bits_per_sample); /* Sample size */ |
|
| 229 |
+ put_be16(pb, enc->bits_per_coded_sample); /* Sample size */ |
|
| 230 | 230 |
|
| 231 | 231 |
sample_rate = av_dbl2ext((double)enc->sample_rate); |
| 232 | 232 |
put_buffer(pb, (uint8_t*)&sample_rate, sizeof(sample_rate)); |
| ... | ... |
@@ -62,8 +62,8 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 62 | 62 |
if (get_le32(pb)) |
| 63 | 63 |
st->codec->channels = 2; |
| 64 | 64 |
|
| 65 |
- st->codec->bits_per_sample = 4; |
|
| 66 |
- st->codec->bit_rate = st->codec->bits_per_sample * st->codec->channels |
|
| 65 |
+ st->codec->bits_per_coded_sample = 4; |
|
| 66 |
+ st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels |
|
| 67 | 67 |
* st->codec->sample_rate; |
| 68 | 68 |
st->codec->block_align = 1; |
| 69 | 69 |
|
| ... | ... |
@@ -424,7 +424,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) |
| 424 | 424 |
st->codec->codec_tag = MKTAG('A', 'P', 'E', ' ');
|
| 425 | 425 |
st->codec->channels = ape->channels; |
| 426 | 426 |
st->codec->sample_rate = ape->samplerate; |
| 427 |
- st->codec->bits_per_sample = ape->bps; |
|
| 427 |
+ st->codec->bits_per_coded_sample = ape->bps; |
|
| 428 | 428 |
st->codec->frame_size = MAC_SUBFRAME_SIZE; |
| 429 | 429 |
|
| 430 | 430 |
st->nb_frames = ape->totalframes; |
| ... | ... |
@@ -315,7 +315,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 315 | 315 |
st->codec->height = get_le32(pb); |
| 316 | 316 |
/* not available for asf */ |
| 317 | 317 |
get_le16(pb); /* panes */ |
| 318 |
- st->codec->bits_per_sample = get_le16(pb); /* depth */ |
|
| 318 |
+ st->codec->bits_per_coded_sample = get_le16(pb); /* depth */ |
|
| 319 | 319 |
tag1 = get_le32(pb); |
| 320 | 320 |
url_fskip(pb, 20); |
| 321 | 321 |
// av_log(NULL, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX); |
| ... | ... |
@@ -329,7 +329,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 329 | 329 |
/* Extract palette from extradata if bpp <= 8 */ |
| 330 | 330 |
/* This code assumes that extradata contains only palette */ |
| 331 | 331 |
/* This is true for all paletted codecs implemented in ffmpeg */ |
| 332 |
- if (st->codec->extradata_size && (st->codec->bits_per_sample <= 8)) {
|
|
| 332 |
+ if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
|
| 333 | 333 |
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl)); |
| 334 | 334 |
#ifdef WORDS_BIGENDIAN |
| 335 | 335 |
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) |
| ... | ... |
@@ -445,7 +445,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 445 | 445 |
st->codec->width = get_le32(pb); |
| 446 | 446 |
st->codec->height = get_le32(pb); |
| 447 | 447 |
get_le16(pb); /* panes */ |
| 448 |
- st->codec->bits_per_sample= get_le16(pb); /* depth */ |
|
| 448 |
+ st->codec->bits_per_coded_sample= get_le16(pb); /* depth */ |
|
| 449 | 449 |
tag1 = get_le32(pb); |
| 450 | 450 |
get_le32(pb); /* ImageSize */ |
| 451 | 451 |
get_le32(pb); /* XPelsPerMeter */ |
| ... | ... |
@@ -472,7 +472,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 472 | 472 |
/* Extract palette from extradata if bpp <= 8. */ |
| 473 | 473 |
/* This code assumes that extradata contains only palette. */ |
| 474 | 474 |
/* This is true for all paletted codecs implemented in FFmpeg. */ |
| 475 |
- if (st->codec->extradata_size && (st->codec->bits_per_sample <= 8)) {
|
|
| 475 |
+ if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
|
| 476 | 476 |
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl)); |
| 477 | 477 |
#ifdef WORDS_BIGENDIAN |
| 478 | 478 |
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) |
| ... | ... |
@@ -182,7 +182,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) |
| 182 | 182 |
avs->st_video->codec->codec_id = CODEC_ID_AVS; |
| 183 | 183 |
avs->st_video->codec->width = avs->width; |
| 184 | 184 |
avs->st_video->codec->height = avs->height; |
| 185 |
- avs->st_video->codec->bits_per_sample=avs->bits_per_sample; |
|
| 185 |
+ avs->st_video->codec->bits_per_coded_sample=avs->bits_per_sample; |
|
| 186 | 186 |
avs->st_video->nb_frames = avs->nb_frames; |
| 187 | 187 |
avs->st_video->codec->time_base = (AVRational) {
|
| 188 | 188 |
1, avs->fps}; |
| ... | ... |
@@ -89,8 +89,8 @@ static int vid_read_header(AVFormatContext *s, |
| 89 | 89 |
stream->codec->codec_id = CODEC_ID_PCM_U8; |
| 90 | 90 |
stream->codec->channels = 1; |
| 91 | 91 |
stream->codec->sample_rate = 11025; |
| 92 |
- stream->codec->bits_per_sample = 8; |
|
| 93 |
- stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_sample; |
|
| 92 |
+ stream->codec->bits_per_coded_sample = 8; |
|
| 93 |
+ stream->codec->bit_rate = stream->codec->channels * stream->codec->sample_rate * stream->codec->bits_per_coded_sample; |
|
| 94 | 94 |
|
| 95 | 95 |
return 0; |
| 96 | 96 |
} |
| ... | ... |
@@ -197,7 +197,7 @@ static int vid_read_packet(AVFormatContext *s, |
| 197 | 197 |
get_le16(pb); |
| 198 | 198 |
// soundblaster DAC used for sample rate, as on specification page (link above) |
| 199 | 199 |
s->streams[1]->codec->sample_rate = 1000000 / (256 - get_byte(pb)); |
| 200 |
- s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample; |
|
| 200 |
+ s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_coded_sample; |
|
| 201 | 201 |
case AUDIO_BLOCK: |
| 202 | 202 |
audio_length = get_le16(pb); |
| 203 | 203 |
ret_value = av_get_packet(pb, pkt, audio_length); |
| ... | ... |
@@ -94,9 +94,9 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) |
| 94 | 94 |
astream->codec->codec_type = CODEC_TYPE_AUDIO; |
| 95 | 95 |
astream->codec->codec_id = CODEC_ID_PCM_U8; |
| 96 | 96 |
astream->codec->channels = 1; |
| 97 |
- astream->codec->bits_per_sample = 8; |
|
| 97 |
+ astream->codec->bits_per_coded_sample = 8; |
|
| 98 | 98 |
astream->codec->bit_rate = |
| 99 |
- astream->codec->sample_rate * astream->codec->bits_per_sample; |
|
| 99 |
+ astream->codec->sample_rate * astream->codec->bits_per_coded_sample; |
|
| 100 | 100 |
url_fseek(pb, chunk_header - 3, SEEK_SET); |
| 101 | 101 |
av_set_pts_info(astream, 64, 1, astream->codec->sample_rate); |
| 102 | 102 |
return 0; |
| ... | ... |
@@ -31,7 +31,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 31 | 31 |
st->codec->sample_rate = 96000; |
| 32 | 32 |
st->codec->bit_rate = 3 * 6 * 96000 * 8; |
| 33 | 33 |
st->codec->block_align = 3 * 6; |
| 34 |
- st->codec->bits_per_sample = 24; |
|
| 34 |
+ st->codec->bits_per_coded_sample = 24; |
|
| 35 | 35 |
return 0; |
| 36 | 36 |
} |
| 37 | 37 |
|
| ... | ... |
@@ -130,9 +130,9 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 130 | 130 |
st->codec->codec_tag = 0; /* no tag */ |
| 131 | 131 |
st->codec->channels = 1; |
| 132 | 132 |
st->codec->sample_rate = 22050; |
| 133 |
- st->codec->bits_per_sample = 16; |
|
| 134 |
- st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample * st->codec->channels; |
|
| 135 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 133 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 134 |
+ st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; |
|
| 135 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 136 | 136 |
|
| 137 | 137 |
return 0; |
| 138 | 138 |
} |
| ... | ... |
@@ -411,10 +411,10 @@ static int ea_read_header(AVFormatContext *s, |
| 411 | 411 |
st->codec->codec_tag = 0; /* no tag */ |
| 412 | 412 |
st->codec->channels = ea->num_channels; |
| 413 | 413 |
st->codec->sample_rate = ea->sample_rate; |
| 414 |
- st->codec->bits_per_sample = ea->bytes * 8; |
|
| 414 |
+ st->codec->bits_per_coded_sample = ea->bytes * 8; |
|
| 415 | 415 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 416 |
- st->codec->bits_per_sample / 4; |
|
| 417 |
- st->codec->block_align = st->codec->channels*st->codec->bits_per_sample; |
|
| 416 |
+ st->codec->bits_per_coded_sample / 4; |
|
| 417 |
+ st->codec->block_align = st->codec->channels*st->codec->bits_per_coded_sample; |
|
| 418 | 418 |
ea->audio_stream_index = st->index; |
| 419 | 419 |
ea->audio_frame_counter = 0; |
| 420 | 420 |
} |
| ... | ... |
@@ -42,7 +42,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c |
| 42 | 42 |
switch(flv_codecid) {
|
| 43 | 43 |
//no distinction between S16 and S8 PCM codec flags |
| 44 | 44 |
case FLV_CODECID_PCM: |
| 45 |
- acodec->codec_id = acodec->bits_per_sample == 8 ? CODEC_ID_PCM_S8 : |
|
| 45 |
+ acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 : |
|
| 46 | 46 |
#ifdef WORDS_BIGENDIAN |
| 47 | 47 |
CODEC_ID_PCM_S16BE; |
| 48 | 48 |
#else |
| ... | ... |
@@ -50,7 +50,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c |
| 50 | 50 |
#endif |
| 51 | 51 |
break; |
| 52 | 52 |
case FLV_CODECID_PCM_LE: |
| 53 |
- acodec->codec_id = acodec->bits_per_sample == 8 ? CODEC_ID_PCM_S8 : CODEC_ID_PCM_S16LE; break; |
|
| 53 |
+ acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 : CODEC_ID_PCM_S16LE; break; |
|
| 54 | 54 |
case FLV_CODECID_AAC : acodec->codec_id = CODEC_ID_AAC; break; |
| 55 | 55 |
case FLV_CODECID_ADPCM: acodec->codec_id = CODEC_ID_ADPCM_SWF; break; |
| 56 | 56 |
case FLV_CODECID_SPEEX: acodec->codec_id = CODEC_ID_SPEEX; break; |
| ... | ... |
@@ -185,7 +185,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst |
| 185 | 185 |
else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val) |
| 186 | 186 |
flv_set_video_codec(s, vstream, (int)num_val); |
| 187 | 187 |
else if(!strcmp(key, "audiosamplesize") && acodec && 0 < (int)num_val) {
|
| 188 |
- acodec->bits_per_sample = num_val; |
|
| 188 |
+ acodec->bits_per_coded_sample = num_val; |
|
| 189 | 189 |
//we may have to rewrite a previously read codecid because FLV only marks PCM endianness. |
| 190 | 190 |
if(num_val == 8 && (acodec->codec_id == CODEC_ID_PCM_S16BE || acodec->codec_id == CODEC_ID_PCM_S16LE)) |
| 191 | 191 |
acodec->codec_id = CODEC_ID_PCM_S8; |
| ... | ... |
@@ -382,13 +382,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 382 | 382 |
} |
| 383 | 383 |
|
| 384 | 384 |
if(is_audio){
|
| 385 |
- if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
|
|
| 385 |
+ if(!st->codec->sample_rate || !st->codec->bits_per_coded_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
|
|
| 386 | 386 |
st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1; |
| 387 | 387 |
if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO) |
| 388 | 388 |
st->codec->sample_rate= 8000; |
| 389 | 389 |
else |
| 390 | 390 |
st->codec->sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3); |
| 391 |
- st->codec->bits_per_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; |
|
| 391 |
+ st->codec->bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; |
|
| 392 | 392 |
flv_set_audio_codec(s, st, flags & FLV_AUDIO_CODECID_MASK); |
| 393 | 393 |
} |
| 394 | 394 |
}else{
|
| ... | ... |
@@ -55,7 +55,7 @@ typedef struct FLVContext {
|
| 55 | 55 |
} FLVContext; |
| 56 | 56 |
|
| 57 | 57 |
static int get_audio_flags(AVCodecContext *enc){
|
| 58 |
- int flags = (enc->bits_per_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT; |
|
| 58 |
+ int flags = (enc->bits_per_coded_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT; |
|
| 59 | 59 |
|
| 60 | 60 |
if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters |
| 61 | 61 |
return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO; |
| ... | ... |
@@ -120,7 +120,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
|
| 120 | 120 |
st->codec->sample_rate = 48000; |
| 121 | 121 |
st->codec->bit_rate = 3 * 1 * 48000 * 8; |
| 122 | 122 |
st->codec->block_align = 3 * 1; |
| 123 |
- st->codec->bits_per_sample = 24; |
|
| 123 |
+ st->codec->bits_per_coded_sample = 24; |
|
| 124 | 124 |
break; |
| 125 | 125 |
case 10: |
| 126 | 126 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -129,7 +129,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) {
|
| 129 | 129 |
st->codec->sample_rate = 48000; |
| 130 | 130 |
st->codec->bit_rate = 2 * 1 * 48000 * 8; |
| 131 | 131 |
st->codec->block_align = 2 * 1; |
| 132 |
- st->codec->bits_per_sample = 16; |
|
| 132 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 133 | 133 |
break; |
| 134 | 134 |
case 17: |
| 135 | 135 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| ... | ... |
@@ -181,7 +181,7 @@ static int idcin_read_header(AVFormatContext *s, |
| 181 | 181 |
st->codec->codec_tag = 1; |
| 182 | 182 |
st->codec->channels = channels; |
| 183 | 183 |
st->codec->sample_rate = sample_rate; |
| 184 |
- st->codec->bits_per_sample = bytes_per_sample * 8; |
|
| 184 |
+ st->codec->bits_per_coded_sample = bytes_per_sample * 8; |
|
| 185 | 185 |
st->codec->bit_rate = sample_rate * bytes_per_sample * 8 * channels; |
| 186 | 186 |
st->codec->block_align = bytes_per_sample * channels; |
| 187 | 187 |
if (bytes_per_sample == 1) |
| ... | ... |
@@ -161,10 +161,10 @@ static int roq_read_header(AVFormatContext *s, |
| 161 | 161 |
st->codec->codec_tag = 0; /* no tag */ |
| 162 | 162 |
st->codec->channels = roq->audio_channels; |
| 163 | 163 |
st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; |
| 164 |
- st->codec->bits_per_sample = 16; |
|
| 164 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 165 | 165 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 166 |
- st->codec->bits_per_sample; |
|
| 167 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 166 |
+ st->codec->bits_per_coded_sample; |
|
| 167 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 168 | 168 |
} |
| 169 | 169 |
|
| 170 | 170 |
return 0; |
| ... | ... |
@@ -149,9 +149,9 @@ static int iff_read_header(AVFormatContext *s, |
| 149 | 149 |
return -1; |
| 150 | 150 |
} |
| 151 | 151 |
|
| 152 |
- st->codec->bits_per_sample = 8; |
|
| 153 |
- st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_sample; |
|
| 154 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 152 |
+ st->codec->bits_per_coded_sample = 8; |
|
| 153 |
+ st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bits_per_coded_sample; |
|
| 154 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 155 | 155 |
|
| 156 | 156 |
return 0; |
| 157 | 157 |
} |
| ... | ... |
@@ -574,12 +574,12 @@ static int ipmovie_read_header(AVFormatContext *s, |
| 574 | 574 |
st->codec->codec_tag = 0; /* no tag */ |
| 575 | 575 |
st->codec->channels = ipmovie->audio_channels; |
| 576 | 576 |
st->codec->sample_rate = ipmovie->audio_sample_rate; |
| 577 |
- st->codec->bits_per_sample = ipmovie->audio_bits; |
|
| 577 |
+ st->codec->bits_per_coded_sample = ipmovie->audio_bits; |
|
| 578 | 578 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 579 |
- st->codec->bits_per_sample; |
|
| 579 |
+ st->codec->bits_per_coded_sample; |
|
| 580 | 580 |
if (st->codec->codec_id == CODEC_ID_INTERPLAY_DPCM) |
| 581 | 581 |
st->codec->bit_rate /= 2; |
| 582 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 582 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 583 | 583 |
} |
| 584 | 584 |
|
| 585 | 585 |
return 0; |
| ... | ... |
@@ -248,8 +248,8 @@ static int mmf_read_header(AVFormatContext *s, |
| 248 | 248 |
st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA; |
| 249 | 249 |
st->codec->sample_rate = rate; |
| 250 | 250 |
st->codec->channels = 1; |
| 251 |
- st->codec->bits_per_sample = 4; |
|
| 252 |
- st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample; |
|
| 251 |
+ st->codec->bits_per_coded_sample = 4; |
|
| 252 |
+ st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample; |
|
| 253 | 253 |
|
| 254 | 254 |
av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
| 255 | 255 |
|
| ... | ... |
@@ -796,13 +796,13 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) |
| 796 | 796 |
st->codec->codec_name[codec_name[0]] = 0; |
| 797 | 797 |
} |
| 798 | 798 |
|
| 799 |
- st->codec->bits_per_sample = get_be16(pb); /* depth */ |
|
| 799 |
+ st->codec->bits_per_coded_sample = get_be16(pb); /* depth */ |
|
| 800 | 800 |
st->codec->color_table_id = get_be16(pb); /* colortable id */ |
| 801 | 801 |
dprintf(c->fc, "depth %d, ctab id %d\n", |
| 802 |
- st->codec->bits_per_sample, st->codec->color_table_id); |
|
| 802 |
+ st->codec->bits_per_coded_sample, st->codec->color_table_id); |
|
| 803 | 803 |
/* figure out the palette situation */ |
| 804 |
- color_depth = st->codec->bits_per_sample & 0x1F; |
|
| 805 |
- color_greyscale = st->codec->bits_per_sample & 0x20; |
|
| 804 |
+ color_depth = st->codec->bits_per_coded_sample & 0x1F; |
|
| 805 |
+ color_greyscale = st->codec->bits_per_coded_sample & 0x20; |
|
| 806 | 806 |
|
| 807 | 807 |
/* if the depth is 2, 4, or 8 bpp, file is palettized */ |
| 808 | 808 |
if ((color_depth == 2) || (color_depth == 4) || |
| ... | ... |
@@ -814,7 +814,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) |
| 814 | 814 |
if (color_greyscale) {
|
| 815 | 815 |
int color_index, color_dec; |
| 816 | 816 |
/* compute the greyscale palette */ |
| 817 |
- st->codec->bits_per_sample = color_depth; |
|
| 817 |
+ st->codec->bits_per_coded_sample = color_depth; |
|
| 818 | 818 |
color_count = 1 << color_depth; |
| 819 | 819 |
color_index = 255; |
| 820 | 820 |
color_dec = 256 / (color_count - 1); |
| ... | ... |
@@ -882,7 +882,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) |
| 882 | 882 |
|
| 883 | 883 |
st->codec->channels = get_be16(pb); /* channel count */ |
| 884 | 884 |
dprintf(c->fc, "audio channels %d\n", st->codec->channels); |
| 885 |
- st->codec->bits_per_sample = get_be16(pb); /* sample size */ |
|
| 885 |
+ st->codec->bits_per_coded_sample = get_be16(pb); /* sample size */ |
|
| 886 | 886 |
|
| 887 | 887 |
sc->audio_cid = get_be16(pb); |
| 888 | 888 |
get_be16(pb); /* packet size = 0 */ |
| ... | ... |
@@ -902,26 +902,26 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) |
| 902 | 902 |
st->codec->sample_rate = av_int2dbl(get_be64(pb)); /* float 64 */ |
| 903 | 903 |
st->codec->channels = get_be32(pb); |
| 904 | 904 |
get_be32(pb); /* always 0x7F000000 */ |
| 905 |
- st->codec->bits_per_sample = get_be32(pb); /* bits per channel if sound is uncompressed */ |
|
| 905 |
+ st->codec->bits_per_coded_sample = get_be32(pb); /* bits per channel if sound is uncompressed */ |
|
| 906 | 906 |
flags = get_be32(pb); /* lcpm format specific flag */ |
| 907 | 907 |
sc->bytes_per_frame = get_be32(pb); /* bytes per audio packet if constant */ |
| 908 | 908 |
sc->samples_per_frame = get_be32(pb); /* lpcm frames per audio packet if constant */ |
| 909 | 909 |
if (format == MKTAG('l','p','c','m'))
|
| 910 |
- st->codec->codec_id = mov_get_lpcm_codec_id(st->codec->bits_per_sample, flags); |
|
| 910 |
+ st->codec->codec_id = mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample, flags); |
|
| 911 | 911 |
} |
| 912 | 912 |
} |
| 913 | 913 |
|
| 914 | 914 |
switch (st->codec->codec_id) {
|
| 915 | 915 |
case CODEC_ID_PCM_S8: |
| 916 | 916 |
case CODEC_ID_PCM_U8: |
| 917 |
- if (st->codec->bits_per_sample == 16) |
|
| 917 |
+ if (st->codec->bits_per_coded_sample == 16) |
|
| 918 | 918 |
st->codec->codec_id = CODEC_ID_PCM_S16BE; |
| 919 | 919 |
break; |
| 920 | 920 |
case CODEC_ID_PCM_S16LE: |
| 921 | 921 |
case CODEC_ID_PCM_S16BE: |
| 922 |
- if (st->codec->bits_per_sample == 8) |
|
| 922 |
+ if (st->codec->bits_per_coded_sample == 8) |
|
| 923 | 923 |
st->codec->codec_id = CODEC_ID_PCM_S8; |
| 924 |
- else if (st->codec->bits_per_sample == 24) |
|
| 924 |
+ else if (st->codec->bits_per_coded_sample == 24) |
|
| 925 | 925 |
st->codec->codec_id = |
| 926 | 926 |
st->codec->codec_id == CODEC_ID_PCM_S16BE ? |
| 927 | 927 |
CODEC_ID_PCM_S24BE : CODEC_ID_PCM_S24LE; |
| ... | ... |
@@ -949,7 +949,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) |
| 949 | 949 |
|
| 950 | 950 |
bits_per_sample = av_get_bits_per_sample(st->codec->codec_id); |
| 951 | 951 |
if (bits_per_sample) {
|
| 952 |
- st->codec->bits_per_sample = bits_per_sample; |
|
| 952 |
+ st->codec->bits_per_coded_sample = bits_per_sample; |
|
| 953 | 953 |
sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; |
| 954 | 954 |
} |
| 955 | 955 |
} else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){
|
| ... | ... |
@@ -684,8 +684,8 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack *track) |
| 684 | 684 |
put_byte(pb, strlen(compressor_name)); |
| 685 | 685 |
put_buffer(pb, compressor_name, 31); |
| 686 | 686 |
|
| 687 |
- if (track->mode == MODE_MOV && track->enc->bits_per_sample) |
|
| 688 |
- put_be16(pb, track->enc->bits_per_sample); |
|
| 687 |
+ if (track->mode == MODE_MOV && track->enc->bits_per_coded_sample) |
|
| 688 |
+ put_be16(pb, track->enc->bits_per_coded_sample); |
|
| 689 | 689 |
else |
| 690 | 690 |
put_be16(pb, 0x18); /* Reserved */ |
| 691 | 691 |
put_be16(pb, 0xffff); /* Reserved */ |
| ... | ... |
@@ -97,7 +97,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 97 | 97 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 98 | 98 |
st->codec->codec_id = CODEC_ID_MUSEPACK7; |
| 99 | 99 |
st->codec->channels = 2; |
| 100 |
- st->codec->bits_per_sample = 16; |
|
| 100 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 101 | 101 |
|
| 102 | 102 |
st->codec->extradata_size = 16; |
| 103 | 103 |
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE); |
| ... | ... |
@@ -182,7 +182,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 182 | 182 |
return AVERROR(ENOMEM); |
| 183 | 183 |
st->codec->codec_type = CODEC_TYPE_AUDIO; |
| 184 | 184 |
st->codec->codec_id = CODEC_ID_MUSEPACK8; |
| 185 |
- st->codec->bits_per_sample = 16; |
|
| 185 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 186 | 186 |
|
| 187 | 187 |
st->codec->extradata_size = 2; |
| 188 | 188 |
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); |
| ... | ... |
@@ -520,13 +520,13 @@ static int mpegps_read_packet(AVFormatContext *s, |
| 520 | 520 |
freq = (b1 >> 4) & 3; |
| 521 | 521 |
st->codec->sample_rate = lpcm_freq_tab[freq]; |
| 522 | 522 |
st->codec->channels = 1 + (b1 & 7); |
| 523 |
- st->codec->bits_per_sample = 16 + ((b1 >> 6) & 3) * 4; |
|
| 523 |
+ st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4; |
|
| 524 | 524 |
st->codec->bit_rate = st->codec->channels * |
| 525 | 525 |
st->codec->sample_rate * |
| 526 |
- st->codec->bits_per_sample; |
|
| 527 |
- if (st->codec->bits_per_sample == 16) |
|
| 526 |
+ st->codec->bits_per_coded_sample; |
|
| 527 |
+ if (st->codec->bits_per_coded_sample == 16) |
|
| 528 | 528 |
st->codec->codec_id = CODEC_ID_PCM_S16BE; |
| 529 |
- else if (st->codec->bits_per_sample == 28) |
|
| 529 |
+ else if (st->codec->bits_per_coded_sample == 28) |
|
| 530 | 530 |
return AVERROR(EINVAL); |
| 531 | 531 |
} |
| 532 | 532 |
av_new_packet(pkt, len); |
| ... | ... |
@@ -102,7 +102,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 102 | 102 |
st->codec->codec_tag = MKTAG('R', 'G', 'B', mtv->img_bpp);
|
| 103 | 103 |
st->codec->width = mtv->img_width; |
| 104 | 104 |
st->codec->height = mtv->img_height; |
| 105 |
- st->codec->bits_per_sample = mtv->img_bpp; |
|
| 105 |
+ st->codec->bits_per_coded_sample = mtv->img_bpp; |
|
| 106 | 106 |
st->codec->sample_rate = mtv->video_fps; |
| 107 | 107 |
|
| 108 | 108 |
/* audio - mp3 */ |
| ... | ... |
@@ -80,7 +80,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 80 | 80 |
ast->codec->codec_type = CODEC_TYPE_AUDIO; |
| 81 | 81 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
| 82 | 82 |
ast->codec->channels = 1; |
| 83 |
- ast->codec->bits_per_sample = 8; |
|
| 83 |
+ ast->codec->bits_per_coded_sample = 8; |
|
| 84 | 84 |
ast->codec->bit_rate = ast->codec->sample_rate * 8; |
| 85 | 85 |
|
| 86 | 86 |
av_set_pts_info(vst, 64, msecs_per_frame, 1000000); |
| ... | ... |
@@ -222,7 +222,7 @@ static int mxf_get_d10_aes3_packet(ByteIOContext *pb, AVStream *st, AVPacket *pk |
| 222 | 222 |
for (; buf_ptr < end_ptr; ) {
|
| 223 | 223 |
for (i = 0; i < st->codec->channels; i++) {
|
| 224 | 224 |
uint32_t sample = bytestream_get_le32(&buf_ptr); |
| 225 |
- if (st->codec->bits_per_sample == 24) |
|
| 225 |
+ if (st->codec->bits_per_coded_sample == 24) |
|
| 226 | 226 |
bytestream_put_le24(&data_ptr, (sample >> 4) & 0xffffff); |
| 227 | 227 |
else |
| 228 | 228 |
bytestream_put_le16(&data_ptr, (sample >> 12) & 0xffff); |
| ... | ... |
@@ -788,7 +788,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) |
| 788 | 788 |
st->codec->codec_id = container_ul->id; |
| 789 | 789 |
st->codec->width = descriptor->width; |
| 790 | 790 |
st->codec->height = descriptor->height; |
| 791 |
- st->codec->bits_per_sample = descriptor->bits_per_sample; /* Uncompressed */ |
|
| 791 |
+ st->codec->bits_per_coded_sample = descriptor->bits_per_sample; /* Uncompressed */ |
|
| 792 | 792 |
st->sample_aspect_ratio = descriptor->aspect_ratio; |
| 793 | 793 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
| 794 | 794 |
} else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
|
| ... | ... |
@@ -796,7 +796,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) |
| 796 | 796 |
if (st->codec->codec_id == CODEC_ID_NONE) |
| 797 | 797 |
st->codec->codec_id = container_ul->id; |
| 798 | 798 |
st->codec->channels = descriptor->channels; |
| 799 |
- st->codec->bits_per_sample = descriptor->bits_per_sample; |
|
| 799 |
+ st->codec->bits_per_coded_sample = descriptor->bits_per_sample; |
|
| 800 | 800 |
st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; |
| 801 | 801 |
/* TODO: implement CODEC_ID_RAWAUDIO */ |
| 802 | 802 |
if (st->codec->codec_id == CODEC_ID_PCM_S16LE) {
|
| ... | ... |
@@ -588,7 +588,7 @@ static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st) |
| 588 | 588 |
put_be32(pb, st->codec->channels); |
| 589 | 589 |
|
| 590 | 590 |
mxf_write_local_tag(pb, 4, 0x3D01); |
| 591 |
- put_be32(pb, st->codec->bits_per_sample); |
|
| 591 |
+ put_be32(pb, st->codec->bits_per_coded_sample); |
|
| 592 | 592 |
} |
| 593 | 593 |
|
| 594 | 594 |
static void mxf_write_package(AVFormatContext *s, enum MXFMetadataSetType type) |
| ... | ... |
@@ -456,7 +456,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) |
| 456 | 456 |
st->codec->codec_id = codec_get_id(nsv_codec_video_tags, vtag); |
| 457 | 457 |
st->codec->width = vwidth; |
| 458 | 458 |
st->codec->height = vheight; |
| 459 |
- st->codec->bits_per_sample = 24; /* depth XXX */ |
|
| 459 |
+ st->codec->bits_per_coded_sample = 24; /* depth XXX */ |
|
| 460 | 460 |
|
| 461 | 461 |
av_set_pts_info(st, 64, framerate.den, framerate.num); |
| 462 | 462 |
st->start_time = 0; |
| ... | ... |
@@ -93,11 +93,11 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst, |
| 93 | 93 |
if (ast) {
|
| 94 | 94 |
ast->codec->codec_tag = get_le32(pb); |
| 95 | 95 |
ast->codec->sample_rate = get_le32(pb); |
| 96 |
- ast->codec->bits_per_sample = get_le32(pb); |
|
| 96 |
+ ast->codec->bits_per_coded_sample = get_le32(pb); |
|
| 97 | 97 |
ast->codec->channels = get_le32(pb); |
| 98 | 98 |
ast->codec->codec_id = |
| 99 | 99 |
wav_codec_get_id(ast->codec->codec_tag, |
| 100 |
- ast->codec->bits_per_sample); |
|
| 100 |
+ ast->codec->bits_per_coded_sample); |
|
| 101 | 101 |
ast->need_parsing = AVSTREAM_PARSE_FULL; |
| 102 | 102 |
} else |
| 103 | 103 |
url_fskip(pb, 4 * 4); |
| ... | ... |
@@ -157,7 +157,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 157 | 157 |
vst->codec->codec_id = CODEC_ID_NUV; |
| 158 | 158 |
vst->codec->width = width; |
| 159 | 159 |
vst->codec->height = height; |
| 160 |
- vst->codec->bits_per_sample = 10; |
|
| 160 |
+ vst->codec->bits_per_coded_sample = 10; |
|
| 161 | 161 |
vst->sample_aspect_ratio = av_d2q(aspect * height / width, 10000); |
| 162 | 162 |
vst->r_frame_rate = av_d2q(fps, 60000); |
| 163 | 163 |
av_set_pts_info(vst, 32, 1, 1000); |
| ... | ... |
@@ -175,7 +175,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 175 | 175 |
ast->codec->sample_rate = 44100; |
| 176 | 176 |
ast->codec->bit_rate = 2 * 2 * 44100 * 8; |
| 177 | 177 |
ast->codec->block_align = 2 * 2; |
| 178 |
- ast->codec->bits_per_sample = 16; |
|
| 178 |
+ ast->codec->bits_per_coded_sample = 16; |
|
| 179 | 179 |
av_set_pts_info(ast, 32, 1, 1000); |
| 180 | 180 |
} else |
| 181 | 181 |
ctx->a_id = -1; |
| ... | ... |
@@ -251,8 +251,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) |
| 251 | 251 |
if (!(bps = av_get_bits_per_sample(enc->codec_id))) |
| 252 | 252 |
bps = 16; // default to 16 |
| 253 | 253 |
} |
| 254 |
- if(bps != enc->bits_per_sample && enc->bits_per_sample){
|
|
| 255 |
- av_log(enc, AV_LOG_WARNING, "requested bits_per_sample (%d) and actually stored (%d) differ\n", enc->bits_per_sample, bps); |
|
| 254 |
+ if(bps != enc->bits_per_coded_sample && enc->bits_per_coded_sample){
|
|
| 255 |
+ av_log(enc, AV_LOG_WARNING, "requested bits_per_coded_sample (%d) and actually stored (%d) differ\n", enc->bits_per_coded_sample, bps); |
|
| 256 | 256 |
} |
| 257 | 257 |
|
| 258 | 258 |
if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 || enc->codec_id == CODEC_ID_AC3) {
|
| ... | ... |
@@ -327,7 +327,7 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *ta |
| 327 | 327 |
put_le32(pb, enc->height); |
| 328 | 328 |
put_le16(pb, 1); /* planes */ |
| 329 | 329 |
|
| 330 |
- put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */ |
|
| 330 |
+ put_le16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24); /* depth */ |
|
| 331 | 331 |
/* compression type */ |
| 332 | 332 |
put_le32(pb, enc->codec_tag); |
| 333 | 333 |
put_le32(pb, enc->width * enc->height * 3); |
| ... | ... |
@@ -363,15 +363,15 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) |
| 363 | 363 |
codec->bit_rate = get_le32(pb) * 8; |
| 364 | 364 |
codec->block_align = get_le16(pb); |
| 365 | 365 |
if (size == 14) { /* We're dealing with plain vanilla WAVEFORMAT */
|
| 366 |
- codec->bits_per_sample = 8; |
|
| 366 |
+ codec->bits_per_coded_sample = 8; |
|
| 367 | 367 |
}else |
| 368 |
- codec->bits_per_sample = get_le16(pb); |
|
| 368 |
+ codec->bits_per_coded_sample = get_le16(pb); |
|
| 369 | 369 |
if (size >= 18) { /* We're obviously dealing with WAVEFORMATEX */
|
| 370 | 370 |
int cbSize = get_le16(pb); /* cbSize */ |
| 371 | 371 |
size -= 18; |
| 372 | 372 |
cbSize = FFMIN(size, cbSize); |
| 373 | 373 |
if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */
|
| 374 |
- codec->bits_per_sample = get_le16(pb); |
|
| 374 |
+ codec->bits_per_coded_sample = get_le16(pb); |
|
| 375 | 375 |
get_le32(pb); /* dwChannelMask */ |
| 376 | 376 |
id = get_le32(pb); /* 4 first bytes of GUID */ |
| 377 | 377 |
url_fskip(pb, 12); /* skip end of GUID */ |
| ... | ... |
@@ -389,7 +389,7 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) |
| 389 | 389 |
if (size > 0) |
| 390 | 390 |
url_fskip(pb, size); |
| 391 | 391 |
} |
| 392 |
- codec->codec_id = wav_codec_get_id(id, codec->bits_per_sample); |
|
| 392 |
+ codec->codec_id = wav_codec_get_id(id, codec->bits_per_coded_sample); |
|
| 393 | 393 |
} |
| 394 | 394 |
|
| 395 | 395 |
|
| ... | ... |
@@ -148,12 +148,12 @@ static av_cold int rl2_read_header(AVFormatContext *s, |
| 148 | 148 |
st->codec->codec_id = CODEC_ID_PCM_U8; |
| 149 | 149 |
st->codec->codec_tag = 1; |
| 150 | 150 |
st->codec->channels = channels; |
| 151 |
- st->codec->bits_per_sample = 8; |
|
| 151 |
+ st->codec->bits_per_coded_sample = 8; |
|
| 152 | 152 |
st->codec->sample_rate = rate; |
| 153 | 153 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 154 |
- st->codec->bits_per_sample; |
|
| 154 |
+ st->codec->bits_per_coded_sample; |
|
| 155 | 155 |
st->codec->block_align = st->codec->channels * |
| 156 |
- st->codec->bits_per_sample / 8; |
|
| 156 |
+ st->codec->bits_per_coded_sample / 8; |
|
| 157 | 157 |
av_set_pts_info(st,32,1,rate); |
| 158 | 158 |
} |
| 159 | 159 |
|
| ... | ... |
@@ -142,7 +142,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 142 | 142 |
vst->codec->codec_tag = read_line_and_int(pb, &error); // video format |
| 143 | 143 |
vst->codec->width = read_line_and_int(pb, &error); // video width |
| 144 | 144 |
vst->codec->height = read_line_and_int(pb, &error); // video height |
| 145 |
- vst->codec->bits_per_sample = read_line_and_int(pb, &error); // video bits per sample |
|
| 145 |
+ vst->codec->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample |
|
| 146 | 146 |
error |= read_line(pb, line, sizeof(line)); // video frames per second |
| 147 | 147 |
fps = read_fps(line, &error); |
| 148 | 148 |
av_set_pts_info(vst, 32, fps.den, fps.num); |
| ... | ... |
@@ -157,7 +157,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 157 | 157 |
case 124: |
| 158 | 158 |
vst->codec->codec_id = CODEC_ID_ESCAPE124; |
| 159 | 159 |
// The header is wrong here, at least sometimes |
| 160 |
- vst->codec->bits_per_sample = 16; |
|
| 160 |
+ vst->codec->bits_per_coded_sample = 16; |
|
| 161 | 161 |
break; |
| 162 | 162 |
#if 0 |
| 163 | 163 |
case 130: |
| ... | ... |
@@ -184,20 +184,20 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 184 | 184 |
ast->codec->codec_tag = audio_format; |
| 185 | 185 |
ast->codec->sample_rate = read_line_and_int(pb, &error); // audio bitrate |
| 186 | 186 |
ast->codec->channels = read_line_and_int(pb, &error); // number of audio channels |
| 187 |
- ast->codec->bits_per_sample = read_line_and_int(pb, &error); // audio bits per sample |
|
| 187 |
+ ast->codec->bits_per_coded_sample = read_line_and_int(pb, &error); // audio bits per sample |
|
| 188 | 188 |
// At least one sample uses 0 for ADPCM, which is really 4 bits |
| 189 | 189 |
// per sample. |
| 190 |
- if (ast->codec->bits_per_sample == 0) |
|
| 191 |
- ast->codec->bits_per_sample = 4; |
|
| 190 |
+ if (ast->codec->bits_per_coded_sample == 0) |
|
| 191 |
+ ast->codec->bits_per_coded_sample = 4; |
|
| 192 | 192 |
|
| 193 | 193 |
ast->codec->bit_rate = ast->codec->sample_rate * |
| 194 |
- ast->codec->bits_per_sample * |
|
| 194 |
+ ast->codec->bits_per_coded_sample * |
|
| 195 | 195 |
ast->codec->channels; |
| 196 | 196 |
|
| 197 | 197 |
ast->codec->codec_id = CODEC_ID_NONE; |
| 198 | 198 |
switch (audio_format) {
|
| 199 | 199 |
case 1: |
| 200 |
- if (ast->codec->bits_per_sample == 16) {
|
|
| 200 |
+ if (ast->codec->bits_per_coded_sample == 16) {
|
|
| 201 | 201 |
// 16-bit audio is always signed |
| 202 | 202 |
ast->codec->codec_id = CODEC_ID_PCM_S16LE; |
| 203 | 203 |
break; |
| ... | ... |
@@ -206,12 +206,12 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 206 | 206 |
// samples needed. |
| 207 | 207 |
break; |
| 208 | 208 |
case 101: |
| 209 |
- if (ast->codec->bits_per_sample == 8) {
|
|
| 209 |
+ if (ast->codec->bits_per_coded_sample == 8) {
|
|
| 210 | 210 |
// The samples with this kind of audio that I have |
| 211 | 211 |
// are all unsigned. |
| 212 | 212 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
| 213 | 213 |
break; |
| 214 |
- } else if (ast->codec->bits_per_sample == 4) {
|
|
| 214 |
+ } else if (ast->codec->bits_per_coded_sample == 4) {
|
|
| 215 | 215 |
ast->codec->codec_id = CODEC_ID_ADPCM_IMA_EA_SEAD; |
| 216 | 216 |
break; |
| 217 | 217 |
} |
| ... | ... |
@@ -148,12 +148,12 @@ static int film_read_header(AVFormatContext *s, |
| 148 | 148 |
st->codec->codec_id = film->audio_type; |
| 149 | 149 |
st->codec->codec_tag = 1; |
| 150 | 150 |
st->codec->channels = film->audio_channels; |
| 151 |
- st->codec->bits_per_sample = film->audio_bits; |
|
| 151 |
+ st->codec->bits_per_coded_sample = film->audio_bits; |
|
| 152 | 152 |
st->codec->sample_rate = film->audio_samplerate; |
| 153 | 153 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 154 |
- st->codec->bits_per_sample; |
|
| 154 |
+ st->codec->bits_per_coded_sample; |
|
| 155 | 155 |
st->codec->block_align = st->codec->channels * |
| 156 |
- st->codec->bits_per_sample / 8; |
|
| 156 |
+ st->codec->bits_per_coded_sample / 8; |
|
| 157 | 157 |
} |
| 158 | 158 |
|
| 159 | 159 |
/* load the sample table */ |
| ... | ... |
@@ -120,13 +120,13 @@ static int vmd_read_header(AVFormatContext *s, |
| 120 | 120 |
st->codec->sample_rate = vmd->sample_rate; |
| 121 | 121 |
st->codec->block_align = AV_RL16(&vmd->vmd_header[806]); |
| 122 | 122 |
if (st->codec->block_align & 0x8000) {
|
| 123 |
- st->codec->bits_per_sample = 16; |
|
| 123 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 124 | 124 |
st->codec->block_align = -(st->codec->block_align - 0x10000); |
| 125 | 125 |
} else {
|
| 126 |
- st->codec->bits_per_sample = 8; |
|
| 126 |
+ st->codec->bits_per_coded_sample = 8; |
|
| 127 | 127 |
} |
| 128 | 128 |
st->codec->bit_rate = st->codec->sample_rate * |
| 129 |
- st->codec->bits_per_sample * st->codec->channels; |
|
| 129 |
+ st->codec->bits_per_coded_sample * st->codec->channels; |
|
| 130 | 130 |
|
| 131 | 131 |
/* calculate pts */ |
| 132 | 132 |
num = st->codec->block_align; |
| ... | ... |
@@ -75,7 +75,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c) |
| 75 | 75 |
ast->codec->codec_type = CODEC_TYPE_AUDIO; |
| 76 | 76 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
| 77 | 77 |
ast->codec->channels = 1; |
| 78 |
- ast->codec->bits_per_sample = c->bits; |
|
| 78 |
+ ast->codec->bits_per_coded_sample = c->bits; |
|
| 79 | 79 |
ast->codec->sample_rate = c->rate; |
| 80 | 80 |
ast->codec->frame_size = c->block_align; |
| 81 | 81 |
av_set_pts_info(ast, 16, 1, c->rate); |
| ... | ... |
@@ -179,11 +179,11 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 179 | 179 |
ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
|
| 180 | 180 |
ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1; |
| 181 | 181 |
ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF; |
| 182 |
- ast[i]->codec->bits_per_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; |
|
| 183 |
- if(ast[i]->codec->bits_per_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) |
|
| 182 |
+ ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; |
|
| 183 |
+ if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) |
|
| 184 | 184 |
ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; |
| 185 | 185 |
av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate |
| 186 |
- * ast[i]->codec->channels * ast[i]->codec->bits_per_sample / 8); |
|
| 186 |
+ * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8); |
|
| 187 | 187 |
} |
| 188 | 188 |
} |
| 189 | 189 |
|
| ... | ... |
@@ -230,9 +230,9 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 230 | 230 |
st->codec->codec_tag = 0; /* no tag */ |
| 231 | 231 |
st->codec->channels = 1; |
| 232 | 232 |
st->codec->sample_rate = SEQ_SAMPLE_RATE; |
| 233 |
- st->codec->bits_per_sample = 16; |
|
| 234 |
- st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample * st->codec->channels; |
|
| 235 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 233 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 234 |
+ st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; |
|
| 235 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 236 | 236 |
|
| 237 | 237 |
return 0; |
| 238 | 238 |
} |
| ... | ... |
@@ -91,7 +91,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 91 | 91 |
st->codec->codec_id = CODEC_ID_TTA; |
| 92 | 92 |
st->codec->channels = channels; |
| 93 | 93 |
st->codec->sample_rate = samplerate; |
| 94 |
- st->codec->bits_per_sample = bps; |
|
| 94 |
+ st->codec->bits_per_coded_sample = bps; |
|
| 95 | 95 |
|
| 96 | 96 |
st->codec->extradata_size = url_ftell(s->pb); |
| 97 | 97 |
if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
|
| ... | ... |
@@ -2166,7 +2166,7 @@ int av_find_stream_info(AVFormatContext *ic) |
| 2166 | 2166 |
for(i=0;i<ic->nb_streams;i++) {
|
| 2167 | 2167 |
st = ic->streams[i]; |
| 2168 | 2168 |
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
|
| 2169 |
- if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_sample) |
|
| 2169 |
+ if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) |
|
| 2170 | 2170 |
st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); |
| 2171 | 2171 |
|
| 2172 | 2172 |
if(duration_count[i] |
| ... | ... |
@@ -2198,8 +2198,8 @@ int av_find_stream_info(AVFormatContext *ic) |
| 2198 | 2198 |
} |
| 2199 | 2199 |
} |
| 2200 | 2200 |
}else if(st->codec->codec_type == CODEC_TYPE_AUDIO) {
|
| 2201 |
- if(!st->codec->bits_per_sample) |
|
| 2202 |
- st->codec->bits_per_sample= av_get_bits_per_sample(st->codec->codec_id); |
|
| 2201 |
+ if(!st->codec->bits_per_coded_sample) |
|
| 2202 |
+ st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id); |
|
| 2203 | 2203 |
} |
| 2204 | 2204 |
} |
| 2205 | 2205 |
|
| ... | ... |
@@ -84,7 +84,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) |
| 84 | 84 |
dec->sample_rate = sample_rate; |
| 85 | 85 |
dec->channels = channels; |
| 86 | 86 |
dec->codec_id = codec_get_id(ff_voc_codec_tags, get_byte(pb)); |
| 87 |
- dec->bits_per_sample = av_get_bits_per_sample(dec->codec_id); |
|
| 87 |
+ dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id); |
|
| 88 | 88 |
voc->remaining_size -= 2; |
| 89 | 89 |
max_size -= 2; |
| 90 | 90 |
channels = 1; |
| ... | ... |
@@ -104,7 +104,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) |
| 104 | 104 |
|
| 105 | 105 |
case VOC_TYPE_NEW_VOICE_DATA: |
| 106 | 106 |
dec->sample_rate = get_le32(pb); |
| 107 |
- dec->bits_per_sample = get_byte(pb); |
|
| 107 |
+ dec->bits_per_coded_sample = get_byte(pb); |
|
| 108 | 108 |
dec->channels = get_byte(pb); |
| 109 | 109 |
dec->codec_id = codec_get_id(ff_voc_codec_tags, get_le16(pb)); |
| 110 | 110 |
url_fskip(pb, 4); |
| ... | ... |
@@ -120,7 +120,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size) |
| 120 | 120 |
} |
| 121 | 121 |
} |
| 122 | 122 |
|
| 123 |
- dec->bit_rate = dec->sample_rate * dec->bits_per_sample; |
|
| 123 |
+ dec->bit_rate = dec->sample_rate * dec->bits_per_coded_sample; |
|
| 124 | 124 |
|
| 125 | 125 |
if (max_size <= 0) |
| 126 | 126 |
max_size = 2048; |
| ... | ... |
@@ -55,7 +55,7 @@ static int voc_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 55 | 55 |
put_byte(pb, VOC_TYPE_NEW_VOICE_DATA); |
| 56 | 56 |
put_le24(pb, pkt->size + 12); |
| 57 | 57 |
put_le32(pb, enc->sample_rate); |
| 58 |
- put_byte(pb, enc->bits_per_sample); |
|
| 58 |
+ put_byte(pb, enc->bits_per_coded_sample); |
|
| 59 | 59 |
put_byte(pb, enc->channels); |
| 60 | 60 |
put_le16(pb, enc->codec_tag); |
| 61 | 61 |
put_le32(pb, 0); |
| ... | ... |
@@ -259,10 +259,10 @@ static int wc3_read_header(AVFormatContext *s, |
| 259 | 259 |
st->codec->codec_id = CODEC_ID_PCM_S16LE; |
| 260 | 260 |
st->codec->codec_tag = 1; |
| 261 | 261 |
st->codec->channels = WC3_AUDIO_CHANNELS; |
| 262 |
- st->codec->bits_per_sample = WC3_AUDIO_BITS; |
|
| 262 |
+ st->codec->bits_per_coded_sample = WC3_AUDIO_BITS; |
|
| 263 | 263 |
st->codec->sample_rate = WC3_SAMPLE_RATE; |
| 264 | 264 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 265 |
- st->codec->bits_per_sample; |
|
| 265 |
+ st->codec->bits_per_coded_sample; |
|
| 266 | 266 |
st->codec->block_align = WC3_AUDIO_BITS * WC3_AUDIO_CHANNELS; |
| 267 | 267 |
|
| 268 | 268 |
return 0; |
| ... | ... |
@@ -154,10 +154,10 @@ static int wsaud_read_header(AVFormatContext *s, |
| 154 | 154 |
st->codec->codec_tag = 0; /* no tag */ |
| 155 | 155 |
st->codec->channels = wsaud->audio_channels; |
| 156 | 156 |
st->codec->sample_rate = wsaud->audio_samplerate; |
| 157 |
- st->codec->bits_per_sample = wsaud->audio_bits; |
|
| 157 |
+ st->codec->bits_per_coded_sample = wsaud->audio_bits; |
|
| 158 | 158 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 159 |
- st->codec->bits_per_sample / 4; |
|
| 160 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 159 |
+ st->codec->bits_per_coded_sample / 4; |
|
| 160 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 161 | 161 |
|
| 162 | 162 |
wsaud->audio_stream_index = st->index; |
| 163 | 163 |
wsaud->audio_frame_counter = 0; |
| ... | ... |
@@ -264,10 +264,10 @@ static int wsvqa_read_header(AVFormatContext *s, |
| 264 | 264 |
st->codec->channels = header[26]; |
| 265 | 265 |
if (!st->codec->channels) |
| 266 | 266 |
st->codec->channels = 1; |
| 267 |
- st->codec->bits_per_sample = 16; |
|
| 267 |
+ st->codec->bits_per_coded_sample = 16; |
|
| 268 | 268 |
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * |
| 269 |
- st->codec->bits_per_sample / 4; |
|
| 270 |
- st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; |
|
| 269 |
+ st->codec->bits_per_coded_sample / 4; |
|
| 270 |
+ st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
|
| 271 | 271 |
|
| 272 | 272 |
wsvqa->audio_stream_index = st->index; |
| 273 | 273 |
wsvqa->audio_samplerate = st->codec->sample_rate; |
| ... | ... |
@@ -151,7 +151,7 @@ static int wv_read_header(AVFormatContext *s, |
| 151 | 151 |
st->codec->codec_id = CODEC_ID_WAVPACK; |
| 152 | 152 |
st->codec->channels = wc->chan; |
| 153 | 153 |
st->codec->sample_rate = wc->rate; |
| 154 |
- st->codec->bits_per_sample = wc->bpp; |
|
| 154 |
+ st->codec->bits_per_coded_sample = wc->bpp; |
|
| 155 | 155 |
av_set_pts_info(st, 64, 1, wc->rate); |
| 156 | 156 |
s->start_time = 0; |
| 157 | 157 |
s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate; |
| ... | ... |
@@ -72,7 +72,7 @@ static int xa_read_header(AVFormatContext *s, |
| 72 | 72 |
/* Value in file is average byte rate*/ |
| 73 | 73 |
st->codec->bit_rate = get_le32(pb) * 8; |
| 74 | 74 |
st->codec->block_align = get_le16(pb); |
| 75 |
- st->codec->bits_per_sample = get_le16(pb); |
|
| 75 |
+ st->codec->bits_per_coded_sample = get_le16(pb); |
|
| 76 | 76 |
|
| 77 | 77 |
av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
| 78 | 78 |
|
| ... | ... |
@@ -180,7 +180,7 @@ do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video" |
| 180 | 180 |
do_video_decoding |
| 181 | 181 |
|
| 182 | 182 |
# mpeg2 encoding intra vlc qprd |
| 183 |
-do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video" |
|
| 183 |
+do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video" |
|
| 184 | 184 |
do_video_decoding |
| 185 | 185 |
|
| 186 | 186 |
#mpeg2 4:2:2 encoding |
| ... | ... |
@@ -262,13 +262,13 @@ do_video_decoding |
| 262 | 262 |
fi |
| 263 | 263 |
|
| 264 | 264 |
if [ -n "$do_mpeg4adv" ] ; then |
| 265 |
-do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4" |
|
| 265 |
+do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4" |
|
| 266 | 266 |
do_video_decoding |
| 267 | 267 |
|
| 268 |
-do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4" |
|
| 268 |
+do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4" |
|
| 269 | 269 |
do_video_decoding |
| 270 | 270 |
|
| 271 |
-do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4" |
|
| 271 |
+do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+mv0 -trellis 1 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4" |
|
| 272 | 272 |
do_video_decoding |
| 273 | 273 |
|
| 274 | 274 |
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4" |
| ... | ... |
@@ -276,7 +276,7 @@ do_video_decoding |
| 276 | 276 |
fi |
| 277 | 277 |
|
| 278 | 278 |
if [ -n "$do_mpeg4thread" ] ; then |
| 279 |
-do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2" |
|
| 279 |
+do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2" |
|
| 280 | 280 |
do_video_decoding |
| 281 | 281 |
fi |
| 282 | 282 |
|
| ... | ... |
@@ -341,7 +341,7 @@ do_video_decoding |
| 341 | 341 |
fi |
| 342 | 342 |
|
| 343 | 343 |
if [ -n "$do_snow" ] ; then |
| 344 |
-do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64" |
|
| 344 |
+do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me_method iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64" |
|
| 345 | 345 |
do_video_decoding "" "-s 352x288" |
| 346 | 346 |
fi |
| 347 | 347 |
|