case PIX_FMT_YUVJ420P:
case PIX_FMT_YUVJ422P:
case PIX_FMT_YUVJ444P:
+ case PIX_FMT_YUVA420P:
w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
h_align= 16;
break;
buf->last_pic_num= *picture_number;
}else{
int h_chroma_shift, v_chroma_shift;
- int pixel_size, size[3];
+ int pixel_size, size[4];
AVPicture picture;
avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
size[1] = avpicture_fill(&picture, NULL, s->pix_fmt, w, h);
size[0] = picture.linesize[0] * h;
size[1] -= size[0];
+ size[2] = size[3] = 0;
if(picture.data[2])
size[1]= size[2]= size[1]/2;
- else
- size[2]= 0;
+ if(picture.data[3])
+ size[3] = picture.linesize[3] * h;
buf->last_pic_num= -256*256*256*64;
memset(buf->base, 0, sizeof(buf->base));
memset(buf->data, 0, sizeof(buf->data));
- for(i=0; i<3 && size[i]; i++){
+ for(i=0; i<4 && size[i]; i++){
const int h_shift= i==0 ? 0 : h_chroma_shift;
const int v_shift= i==0 ? 0 : v_chroma_shift;
FFSWAP(InternalBuffer, *buf, *last);
- for(i=0; i<3; i++){
+ for(i=0; i<4; i++){
pic->data[i]=NULL;
// pic->base[i]=NULL;
}
{"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E},
{"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_DROP_FRAME_TIMECODE, INT_MIN, INT_MAX, V|E, "flags2"},
{"non_linear_q", "use non linear quantizer", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_NON_LINEAR_QUANT, INT_MIN, INT_MAX, V|E, "flags2"},
+{"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D},
{NULL},
};
return -1;
}
if(*frame_size_ptr < FF_MIN_BUFFER_SIZE ||
- *frame_size_ptr < avctx->channels * avctx->frame_size * sizeof(int16_t) ||
- *frame_size_ptr < buf_size){
+ *frame_size_ptr < avctx->channels * avctx->frame_size * sizeof(int16_t)){
av_log(avctx, AV_LOG_ERROR, "buffer %d too small\n", *frame_size_ptr);
return -1;
}
char buf1[32];
char channels_str[100];
int bitrate;
+ AVRational display_aspect_ratio;
if (encode)
p = avcodec_find_encoder(enc->codec_id);
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %dx%d",
enc->width, enc->height);
+ av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
+ enc->width*enc->sample_aspect_ratio.num,
+ enc->height*enc->sample_aspect_ratio.den,
+ 1024*1024);
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " [PAR %d:%d DAR %d:%d]",
+ enc->sample_aspect_ratio.num, enc->sample_aspect_ratio.den,
+ display_aspect_ratio.num, display_aspect_ratio.den);
if(av_log_level >= AV_LOG_DEBUG){
int g= ff_gcd(enc->time_base.num, enc->time_base.den);
snprintf(buf + strlen(buf), buf_size - strlen(buf),