Merge commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a'
authorMark Thompson <sw@jkqxz.net>
Wed, 21 Feb 2018 22:43:13 +0000 (22:43 +0000)
committerMark Thompson <sw@jkqxz.net>
Wed, 21 Feb 2018 22:51:46 +0000 (22:51 +0000)
* commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a':
  cbs_h264: Add support for filler NAL units

Some bitstream -> get_bits.

Merged-by: Mark Thompson <sw@jkqxz.net>
1  2 
libavcodec/cbs_h264.h
libavcodec/cbs_h2645.c
libavcodec/cbs_h264_syntax_template.c

Simple merge
@@@ -815,6 -815,19 +815,19 @@@ static int cbs_h264_read_nal_unit(Coded
          }
          break;
  
 -            err = cbs_h264_read_filler(ctx, &bc, unit->content);
+     case H264_NAL_FILLER_DATA:
+         {
+             err = ff_cbs_alloc_unit_content(ctx, unit,
+                                             sizeof(H264RawFiller), NULL);
+             if (err < 0)
+                 return err;
++            err = cbs_h264_read_filler(ctx, &gbc, unit->content);
+             if (err < 0)
+                 return err;
+         }
+         break;
      default:
          return AVERROR(ENOSYS);
      }
@@@ -1247,3 -1247,32 +1247,32 @@@ static int FUNC(slice_header)(CodedBits
  
      return 0;
  }
 -    while (bitstream_peek(rw, 8) == 0xff) {
+ static int FUNC(filler)(CodedBitstreamContext *ctx, RWContext *rw,
+                         H264RawFiller *current)
+ {
+     av_unused int ff_byte = 0xff;
+     int err;
+     HEADER("Filler Data");
+     CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header,
+                                 1 << H264_NAL_FILLER_DATA));
+ #ifdef READ
++    while (show_bits(rw, 8) == 0xff) {
+         xu(8, ff_byte, ff_byte, 0xff, 0xff);
+         ++current->filler_size;
+     }
+ #else
+     {
+         uint32_t i;
+         for (i = 0; i < current->filler_size; i++)
+             xu(8, ff_byte, ff_byte, 0xff, 0xff);
+     }
+ #endif
+     CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
+     return 0;
+ }