]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dirac.h
nvenc: Allow different const qps for I, P and B frames
[ffmpeg] / libavcodec / dirac.h
index e5b79b09d2971463f1fdb0137202abc002b3e28b..25cefdb626d4c0584c8c6f68e5d9da74c12d08e6 100644 (file)
@@ -29,9 +29,8 @@
  */
 
 #include "avcodec.h"
-#include "get_bits.h"
 
-typedef struct dirac_source_params {
+typedef struct AVDiracSeqHeader {
     unsigned width;
     unsigned height;
     uint8_t chroma_format;          ///< 0: 444  1: 422  2: 420
@@ -49,9 +48,33 @@ typedef struct dirac_source_params {
 
     uint8_t pixel_range_index;      ///< index into dirac_pixel_range_presets[]
     uint8_t color_spec_index;       ///< index into dirac_color_spec_presets[]
-} dirac_source_params;
 
-int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
-                                       dirac_source_params *source);
+    int profile;
+    int level;
+
+    AVRational framerate;
+    AVRational sample_aspect_ratio;
+
+    enum AVPixelFormat pix_fmt;
+    enum AVColorRange color_range;
+    enum AVColorPrimaries color_primaries;
+    enum AVColorTransferCharacteristic color_trc;
+    enum AVColorSpace colorspace;
+} AVDiracSeqHeader;
+
+/**
+ * Parse a Dirac sequence header.
+ *
+ * @param dsh this function will allocate and fill an AVDiracSeqHeader struct
+ *            and write it into this pointer. The caller must free it with
+ *            av_free().
+ * @param buf the data buffer
+ * @param buf_size the size of the data buffer in bytes
+ * @param log_ctx if non-NULL, this function will log errors here
+ * @return 0 on success, a negative AVERROR code on failure
+ */
+int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh,
+                                   const uint8_t *buf, size_t buf_size,
+                                   void *log_ctx);
 
 #endif /* AVCODEC_DIRAC_H */