Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Dec 2011 00:02:37 +0000 (01:02 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Dec 2011 00:02:37 +0000 (01:02 +0100)
* qatar/master:
  h264: fix frame reordering code.
  fate: Add a test for the VBLE decoder
  doc: break some long lines in developer.texi
  drawtext: make x and y parametric
  drawtext: manage memory allocation better
  drawtext: refactor draw_text
  doc: remove space between variable and post increment in example code

Conflicts:
doc/developer.texi
doc/filters.texi
libavcodec/h264.c
libavfilter/vf_drawtext.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
doc/developer.texi
doc/filters.texi
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_refs.c
tests/fate/h264.mak
tests/fate2.mak

@@@ -140,10 -169,11 +141,11 @@@ GCC statement expressions (@samp{(x = (
  @end itemize
  
  @subsection Naming conventions
 -All names are using underscores (_), not CamelCase. For example,
 -@samp{avfilter_get_video_buffer} is a valid function name and
 -@samp{AVFilterGetVideo} is not. The only exception from this are structure
 -names; they should always be in the CamelCase
 +All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
 +a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
 +for example structs and enums; they should always be in the CamelCase
 +
  There are following conventions for naming variables and functions:
  @itemize @bullet
  @item
Simple merge
@@@ -1510,11 -1489,27 +1522,28 @@@ static void decode_postinit(H264Contex
              out = h->delayed_pic[i];
              out_idx = i;
          }
-     if (s->avctx->has_b_frames == 0 && (h->delayed_pic[0]->f.key_frame || h->delayed_pic[0]->mmco_reset))
-         h->next_outputed_poc= INT_MIN;
-     out_of_order = out->poc < h->next_outputed_poc;
+     }
+     if (s->avctx->has_b_frames == 0 && (h->delayed_pic[0]->f.key_frame || h->mmco_reset))
+         h->next_outputed_poc = INT_MIN;
+     out_of_order = !out->f.key_frame && !h->mmco_reset && (out->poc < h->next_outputed_poc);
+     if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames)
+         { }
+     else if (out_of_order && pics-1 == s->avctx->has_b_frames &&
+              s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT) {
+         if (invalid + cnt < MAX_DELAYED_PIC_COUNT) {
+             s->avctx->has_b_frames = FFMAX(s->avctx->has_b_frames, cnt);
++            av_log(0,0, "hbf: %d\n", s->avctx->has_b_frames );
+         }
+         s->low_delay = 0;
+     } else if (s->low_delay &&
+                ((h->next_outputed_poc != INT_MIN && out->poc > h->next_outputed_poc + 2) ||
+                 cur->f.pict_type == AV_PICTURE_TYPE_B)) {
+         s->low_delay = 0;
+         s->avctx->has_b_frames++;
+     }
  
-     if(out_of_order || pics > s->avctx->has_b_frames){
+     if(pics > s->avctx->has_b_frames){
          out->f.reference &= ~DELAYED_PIC_REF;
          out->owner2 = s; // for frame threading, the owner must be the second field's thread
                           // or else the first thread can release the picture and reuse it unsafely
Simple merge
Simple merge
@@@ -345,8 -323,8 +345,8 @@@ fate-h264-conformance-mps_mw_a: CMD = f
  fate-h264-conformance-mr1_bt_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR1_BT_A.h264
  fate-h264-conformance-mr1_mw_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR1_MW_A.264
  fate-h264-conformance-mr2_mw_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR2_MW_A.264
--fate-h264-conformance-mr2_tandberg_e: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR2_TANDBERG_E.264
--fate-h264-conformance-mr3_tandberg_b: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR3_TANDBERG_B.264
++fate-h264-conformance-mr2_tandberg_e: CMD = framecrc  -vsync 0 -i $(SAMPLES)/h264-conformance/MR2_TANDBERG_E.264
++fate-h264-conformance-mr3_tandberg_b: CMD = framecrc  -vsync 0 -i $(SAMPLES)/h264-conformance/MR3_TANDBERG_B.264
  fate-h264-conformance-mr4_tandberg_c: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR4_TANDBERG_C.264
  fate-h264-conformance-mr5_tandberg_c: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR5_TANDBERG_C.264
  fate-h264-conformance-mr6_bt_b: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR6_BT_B.h264
diff --cc tests/fate2.mak
Simple merge