]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cbs_internal.h
avcodec/clearvideo: add missing wrappers to clearvideodata.h
[ffmpeg] / libavcodec / cbs_internal.h
index 1a1c22f0680c81d8206249ed2db6d92def106326..be540e2a44d3df62c548396f8eb3451bcbd97eac 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -20,8 +20,8 @@
 #define AVCODEC_CBS_INTERNAL_H
 
 #include "avcodec.h"
-#include "bitstream.h"
 #include "cbs.h"
+#include "get_bits.h"
 #include "put_bits.h"
 
 
@@ -53,9 +53,6 @@ typedef struct CodedBitstreamType {
     int (*assemble_fragment)(CodedBitstreamContext *ctx,
                              CodedBitstreamFragment *frag);
 
-    // Free the content and data of a single unit.
-    void (*free_unit)(CodedBitstreamUnit *unit);
-
     // Free the codec internal state.
     void (*close)(CodedBitstreamContext *ctx);
 } CodedBitstreamType;
@@ -74,7 +71,7 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx,
 // Helper functions for read/write of common bitstream elements, including
 // generation of trace output.
 
-int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, BitstreamContext *bc,
+int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc,
                          int width, const char *name, uint32_t *write_to,
                          uint32_t range_min, uint32_t range_max);
 
@@ -82,6 +79,10 @@ int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc,
                           int width, const char *name, uint32_t value,
                           uint32_t range_min, uint32_t range_max);
 
+// The largest value representable in N bits, suitable for use as
+// range_max in the above functions.
+#define MAX_UINT_BITS(length) ((UINT64_C(1) << (length)) - 1)
+
 
 extern const CodedBitstreamType ff_cbs_type_h264;
 extern const CodedBitstreamType ff_cbs_type_h265;