[FFmpeg-devel] [PATCH 05/11] diracdec: Extract version parameters
Kieran Kunhya
kierank at ob-encoder.com
Wed Dec 9 01:05:31 CET 2015
---
libavcodec/dirac.c | 1 +
libavcodec/dirac.h | 6 ++++++
libavcodec/diracdec.c | 3 ++-
libavformat/oggparsedirac.c | 3 ++-
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
index aa82dd9..fd6e869 100644
--- a/libavcodec/dirac.c
+++ b/libavcodec/dirac.c
@@ -294,6 +294,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
/* [DIRAC_STD] 10. Sequence Header. sequence_header() */
int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
dirac_source_params *source,
+ DiracVersionInfo *version,
int *bit_depth)
{
unsigned version_major;
diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h
index 14653f1..6852e82 100644
--- a/libavcodec/dirac.h
+++ b/libavcodec/dirac.h
@@ -34,6 +34,11 @@
#include "avcodec.h"
#include "get_bits.h"
+typedef struct DiracVersionInfo {
+ int major;
+ int minor;
+} DiracVersionInfo;
+
typedef struct dirac_source_params {
unsigned width;
unsigned height;
@@ -56,6 +61,7 @@ typedef struct dirac_source_params {
int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
dirac_source_params *source,
+ DiracVersionInfo *version,
int *bit_depth);
#endif /* AVCODEC_DIRAC_H */
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index fca722d..5b0634c 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -140,6 +140,7 @@ typedef struct DiracContext {
MpegvideoEncDSPContext mpvencdsp;
VideoDSPContext vdsp;
DiracDSPContext diracdsp;
+ DiracVersionInfo version;
GetBitContext gb;
dirac_source_params source;
int seen_sequence_header;
@@ -1913,7 +1914,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
return 0;
/* [DIRAC_STD] 10. Sequence header */
- ret = avpriv_dirac_parse_sequence_header(avctx, &s->gb, &s->source,
+ ret = avpriv_dirac_parse_sequence_header(avctx, &s->gb, &s->source, &s->version,
&s->bit_depth);
s->pshift = s->bit_depth > 8;
if (ret < 0)
diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c
index b317f5a..2835ac7 100644
--- a/libavformat/oggparsedirac.c
+++ b/libavformat/oggparsedirac.c
@@ -30,6 +30,7 @@ static int dirac_header(AVFormatContext *s, int idx)
struct ogg_stream *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
dirac_source_params source;
+ DiracVersionInfo version;
GetBitContext gb;
int ret, bit_depth;
@@ -41,7 +42,7 @@ static int dirac_header(AVFormatContext *s, int idx)
if (ret < 0)
return ret;
- ret = avpriv_dirac_parse_sequence_header(st->codec, &gb, &source, &bit_depth);
+ ret = avpriv_dirac_parse_sequence_header(st->codec, &gb, &source, &version, &bit_depth);
if (ret < 0)
return ret;
--
1.9.1
More information about the ffmpeg-devel
mailing list