v->finterpflag = get_bits1(gb);
skip_bits1(gb); // reserved
- v->s.h_edge_pos = w;
- v->s.v_edge_pos = h;
-
av_log(v->s.avctx, AV_LOG_DEBUG,
"Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
"LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n"
}
v->s.max_b_frames = v->s.avctx->max_b_frames = 7;
if(get_bits1(gb)) { //Display Info - decoding is not affected by it
- int dw, dh, ar = 0;
+ int w, h, ar = 0;
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
- dw = get_bits(gb, 14) + 1;
- dh = get_bits(gb, 14) + 1;
- v->s.avctx->sample_aspect_ratio = av_div_q((AVRational){dw, dh}, (AVRational){w, h});
- av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", dw, dh);
+ w = get_bits(gb, 14) + 1;
+ h = get_bits(gb, 14) + 1;
+ av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", w, h);
if(get_bits1(gb))
ar = get_bits(gb, 4);
if(ar && ar < 14){
w = get_bits(gb, 8) + 1;
h = get_bits(gb, 8) + 1;
v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
+ } else {
+ av_reduce(&v->s.avctx->sample_aspect_ratio.num,
+ &v->s.avctx->sample_aspect_ratio.den,
+ v->s.avctx->height * w,
+ v->s.avctx->width * h,
+ 1<<30);
}
av_log(v->s.avctx, AV_LOG_DEBUG, "Aspect: %i:%i\n", v->s.avctx->sample_aspect_ratio.num, v->s.avctx->sample_aspect_ratio.den);