mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
Merge branch 'master' into 0.11
This commit is contained in:
commit
effab293cb
6 changed files with 1512 additions and 560 deletions
|
@ -52,7 +52,7 @@ MAX_HRD_NUM_LEAKY_BUCKETS
|
|||
GST_VC1_BFRACTION_BASIS
|
||||
GstVC1StartCode
|
||||
GstVC1Profile
|
||||
GstVC1ParseResult
|
||||
GstVC1ParserResult
|
||||
GstVC1PictureType
|
||||
GstVC1Level
|
||||
GstVC1QuantizerSpec
|
||||
|
@ -61,7 +61,10 @@ GstVC1Condover
|
|||
GstVC1MvMode
|
||||
GstVC1SeqHdr
|
||||
GstVC1AdvancedSeqHdr
|
||||
GstVC1SimpleMainSeqHdr
|
||||
GstVC1SeqLayer
|
||||
GstVC1SeqStructA
|
||||
GstVC1SeqStructB
|
||||
GstVC1SeqStructC
|
||||
GstVC1HrdParam
|
||||
GstVC1EntryPointHdr
|
||||
GstVC1FrameHdr
|
||||
|
@ -72,8 +75,16 @@ GstVC1VopDquant
|
|||
GstVC1BDU
|
||||
gst_vc1_identify_next_bdu
|
||||
gst_vc1_parse_sequence_header
|
||||
gst_vc1_parse_sequence_layer
|
||||
gst_vc1_parse_sequence_header_struct_a
|
||||
gst_vc1_parse_sequence_header_struct_b
|
||||
gst_vc1_parse_sequence_header_struct_c
|
||||
gst_vc1_parse_entry_point_header
|
||||
gst_vc1_parse_frame_header
|
||||
gst_vc1_bitplanes_new
|
||||
gst_vc1_bitplanes_free
|
||||
gst_vc1_bitplanes_free_1
|
||||
gst_vc1_bitplanes_ensure_size
|
||||
<SUBSECTION Standard>
|
||||
<SUBSECTION Private>
|
||||
</SECTION>
|
||||
|
|
|
@ -520,7 +520,7 @@ gst_mpeg_video_parse_quant_matrix_extension (GstMpegVideoQuantMatrixExt * quant,
|
|||
}
|
||||
|
||||
READ_UINT8 (&br, quant->load_chroma_intra_quantiser_matrix, 1);
|
||||
if (quant->load_non_intra_quantiser_matrix) {
|
||||
if (quant->load_chroma_intra_quantiser_matrix) {
|
||||
for (i = 0; i < 64; i++) {
|
||||
READ_UINT8 (&br, quant->chroma_intra_quantiser_matrix[mpeg_zigzag_8x8[i]],
|
||||
8);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,7 +37,10 @@ G_BEGIN_DECLS
|
|||
* @GST_VC1_BFRACTION_BASIS: The @bfraction variable should be divided
|
||||
* by this constant to have the actual value.
|
||||
*/
|
||||
#define GST_VC1_BFRACTION_BASIS 256
|
||||
#define GST_VC1_BFRACTION_BASIS 840
|
||||
|
||||
#define GST_VC1_BFRACTION_RESERVED (GST_VC1_BFRACTION_BASIS + 1)
|
||||
#define GST_VC1_BFRACTION_PTYPE_BI (GST_VC1_BFRACTION_BASIS + 2)
|
||||
|
||||
typedef enum {
|
||||
GST_VC1_END_OF_SEQ = 0x0A,
|
||||
|
@ -66,7 +69,7 @@ typedef enum {
|
|||
GST_VC1_PARSER_NO_BDU,
|
||||
GST_VC1_PARSER_NO_BDU_END,
|
||||
GST_VC1_PARSER_ERROR,
|
||||
} GstVC1ParseResult;
|
||||
} GstVC1ParserResult;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -79,9 +82,9 @@ typedef enum
|
|||
|
||||
typedef enum
|
||||
{
|
||||
GST_VC1_LEVEL_LOW = 0, /* Simple/Main profile low level */
|
||||
GST_VC1_LEVELMEDIUM = 1, /* Simple/Main profile medium level */
|
||||
GST_VC1_LEVELHIGH = 2, /* Main profile high level */
|
||||
GST_VC1_LEVEL_LOW = 0, /* Simple/Main profile low level */
|
||||
GST_VC1_LEVEL_MEDIUM = 1, /* Simple/Main profile medium level */
|
||||
GST_VC1_LEVEL_HIGH = 2, /* Main profile high level */
|
||||
|
||||
GST_VC1_LEVEL_L0 = 0, /* Advanced profile level 0 */
|
||||
GST_VC1_LEVEL_L1 = 1, /* Advanced profile level 1 */
|
||||
|
@ -127,13 +130,26 @@ typedef enum
|
|||
GST_VC1_MVMODE_INTENSITY_COMP
|
||||
} GstVC1MvMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GST_VC1_FRAME_PROGRESSIVE = 0x0,
|
||||
GST_VC1_FRAME_INTERLACE = 0x10,
|
||||
GST_VC1_FIELD_INTERLACE = 0x11
|
||||
} GstVC1FrameCodingMode;
|
||||
|
||||
typedef struct _GstVC1SeqHdr GstVC1SeqHdr;
|
||||
typedef struct _GstVC1AdvancedSeqHdr GstVC1AdvancedSeqHdr;
|
||||
typedef struct _GstVC1SimpleMainSeqHdr GstVC1SimpleMainSeqHdr;
|
||||
typedef struct _GstVC1HrdParam GstVC1HrdParam;
|
||||
typedef struct _GstVC1EntryPointHdr GstVC1EntryPointHdr;
|
||||
|
||||
typedef struct _GstVC1SeqLayer GstVC1SeqLayer;
|
||||
|
||||
typedef struct _GstVC1SeqStructA GstVC1SeqStructA;
|
||||
typedef struct _GstVC1SeqStructB GstVC1SeqStructB;
|
||||
typedef struct _GstVC1SeqStructC GstVC1SeqStructC;
|
||||
|
||||
/* Pictures Structures */
|
||||
typedef struct _GstVC1FrameLayer GstVC1FrameLayer;
|
||||
typedef struct _GstVC1FrameHdr GstVC1FrameHdr;
|
||||
typedef struct _GstVC1PicAdvanced GstVC1PicAdvanced;
|
||||
typedef struct _GstVC1PicSimpleMain GstVC1PicSimpleMain;
|
||||
|
@ -141,6 +157,8 @@ typedef struct _GstVC1Picture GstVC1Picture;
|
|||
|
||||
typedef struct _GstVC1VopDquant GstVC1VopDquant;
|
||||
|
||||
typedef struct _GstVC1BitPlanes GstVC1BitPlanes;
|
||||
|
||||
typedef struct _GstVC1BDU GstVC1BDU;
|
||||
|
||||
struct _GstVC1HrdParam
|
||||
|
@ -152,37 +170,6 @@ struct _GstVC1HrdParam
|
|||
guint16 hrd_buffer[MAX_HRD_NUM_LEAKY_BUCKETS];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVC1SimpleMainSeqHdr:
|
||||
*
|
||||
* Structure for simple and main profile sequence headers specific parameters.
|
||||
*/
|
||||
struct _GstVC1SimpleMainSeqHdr
|
||||
{
|
||||
guint8 res_sprite;
|
||||
guint8 loop_filter;
|
||||
guint8 multires;
|
||||
guint8 fastuvmc;
|
||||
guint8 extended_mv;
|
||||
guint8 dquant;
|
||||
guint8 vstransform;
|
||||
guint8 overlap;
|
||||
guint8 syncmarker;
|
||||
guint8 rangered;
|
||||
guint8 maxbframes;
|
||||
guint8 quantizer;
|
||||
|
||||
/* This should be filled by user if previously known */
|
||||
guint16 coded_width;
|
||||
/* This should be filled by user if previously known */
|
||||
guint16 coded_height;
|
||||
|
||||
/* Wmvp specific */
|
||||
guint8 wmvp; /* Specify if the stream is wmp or not */
|
||||
guint8 framerate;
|
||||
guint8 slice_code;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVC1EntryPointHdr:
|
||||
*
|
||||
|
@ -220,13 +207,17 @@ struct _GstVC1EntryPointHdr
|
|||
*/
|
||||
struct _GstVC1AdvancedSeqHdr
|
||||
{
|
||||
guint8 level;
|
||||
GstVC1Level level;
|
||||
|
||||
guint8 frmrtq_postproc;
|
||||
guint8 bitrtq_postproc;
|
||||
guint8 postprocflag;
|
||||
guint16 max_coded_width;
|
||||
guint16 max_coded_height;
|
||||
guint8 pulldown;
|
||||
guint8 interlace;
|
||||
guint8 tfcntrflag;
|
||||
guint8 finterpflag;
|
||||
guint8 psf;
|
||||
guint8 display_ext;
|
||||
guint16 disp_horiz_size;
|
||||
|
@ -245,13 +236,85 @@ struct _GstVC1AdvancedSeqHdr
|
|||
guint8 transfer_char;
|
||||
guint8 matrix_coef;
|
||||
guint8 hrd_param_flag;
|
||||
guint8 colordiff_format;
|
||||
|
||||
GstVC1HrdParam hrd_param;
|
||||
|
||||
/* computed */
|
||||
guint framerate; /* Around in fps, 0 if unknown*/
|
||||
guint bitrate; /* Around in kpbs, 0 if unknown*/
|
||||
guint par_n;
|
||||
guint par_d;
|
||||
guint fps_n;
|
||||
guint fps_d;
|
||||
|
||||
/* The last parsed entry point */
|
||||
GstVC1EntryPointHdr entrypoint;
|
||||
};
|
||||
|
||||
struct _GstVC1SeqStructA
|
||||
{
|
||||
guint32 vert_size;
|
||||
guint32 horiz_size;
|
||||
};
|
||||
|
||||
struct _GstVC1SeqStructB
|
||||
{
|
||||
GstVC1Level level;
|
||||
|
||||
guint8 cbr;
|
||||
guint32 framerate;
|
||||
|
||||
/* In simple and main profiles only */
|
||||
guint32 hrd_buffer;
|
||||
guint32 hrd_rate;
|
||||
};
|
||||
|
||||
struct _GstVC1SeqStructC
|
||||
{
|
||||
GstVC1Profile profile;
|
||||
|
||||
/* Only in simple and main profiles */
|
||||
guint8 frmrtq_postproc;
|
||||
guint8 bitrtq_postproc;
|
||||
guint8 res_sprite;
|
||||
guint8 loop_filter;
|
||||
guint8 multires;
|
||||
guint8 fastuvmc;
|
||||
guint8 extended_mv;
|
||||
guint8 dquant;
|
||||
guint8 vstransform;
|
||||
guint8 overlap;
|
||||
guint8 syncmarker;
|
||||
guint8 rangered;
|
||||
guint8 maxbframes;
|
||||
guint8 quantizer;
|
||||
guint8 finterpflag;
|
||||
|
||||
/* Computed */
|
||||
guint framerate; /* Around in fps, 0 if unknown*/
|
||||
guint bitrate; /* Around in kpbs, 0 if unknown*/
|
||||
|
||||
/* This should be filled by user if previously known */
|
||||
guint16 coded_width;
|
||||
/* This should be filled by user if previously known */
|
||||
guint16 coded_height;
|
||||
|
||||
/* Wmvp specific */
|
||||
guint8 wmvp; /* Specify if the stream is wmp or not */
|
||||
/* In the wmvp case, the framerate is not computed but in the bistream */
|
||||
guint8 slice_code;
|
||||
};
|
||||
|
||||
struct _GstVC1SeqLayer
|
||||
{
|
||||
guint32 numframes;
|
||||
|
||||
GstVC1SeqStructA struct_a;
|
||||
GstVC1SeqStructB struct_b;
|
||||
GstVC1SeqStructC struct_c;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVC1SeqHdr:
|
||||
*
|
||||
|
@ -259,20 +322,16 @@ struct _GstVC1AdvancedSeqHdr
|
|||
*/
|
||||
struct _GstVC1SeqHdr
|
||||
{
|
||||
guint8 profiletype;
|
||||
guint8 colordiff_format;
|
||||
guint8 frmrtq_postproc;
|
||||
guint8 bitrtq_postproc;
|
||||
guint8 finterpflag;
|
||||
GstVC1Profile profile;
|
||||
|
||||
GstVC1SeqStructC struct_c;
|
||||
|
||||
/* calculated */
|
||||
guint framerate; /* Around in fps, 0 if unknown*/
|
||||
guint bitrate; /* Around in kpbs, 0 if unknown*/
|
||||
guint mb_height;
|
||||
guint mb_width;
|
||||
guint mb_stride;
|
||||
|
||||
union {
|
||||
GstVC1AdvancedSeqHdr advanced;
|
||||
GstVC1SimpleMainSeqHdr simplemain;
|
||||
} profile;
|
||||
GstVC1AdvancedSeqHdr advanced;
|
||||
|
||||
};
|
||||
|
||||
|
@ -310,7 +369,7 @@ struct _GstVC1PicSimpleMain
|
|||
/* B and BI picture only
|
||||
* Should be divided by #GST_VC1_BFRACTION_BASIS
|
||||
* to get the real value. */
|
||||
guint8 bfraction;
|
||||
guint16 bfraction;
|
||||
|
||||
/* Biplane value, those fields only mention the fact
|
||||
* that the bitplane is in raw mode or not */
|
||||
|
@ -326,7 +385,7 @@ struct _GstVC1PicSimpleMain
|
|||
*/
|
||||
struct _GstVC1PicAdvanced
|
||||
{
|
||||
guint8 fcm;
|
||||
GstVC1FrameCodingMode fcm;
|
||||
guint8 tfcntr;
|
||||
|
||||
guint8 rptfrm;
|
||||
|
@ -352,7 +411,7 @@ struct _GstVC1PicAdvanced
|
|||
/* B and BI picture only
|
||||
* Should be divided by #GST_VC1_BFRACTION_BASIS
|
||||
* to get the real value. */
|
||||
guint8 bfraction;
|
||||
guint16 bfraction;
|
||||
|
||||
/* ppic */
|
||||
guint8 mvmode2;
|
||||
|
@ -371,14 +430,56 @@ struct _GstVC1PicAdvanced
|
|||
guint8 mvtypemb;
|
||||
guint8 skipmb;
|
||||
guint8 directmb;
|
||||
guint8 forwardmb; /* B pic interlace field only */
|
||||
|
||||
/* For interlaced pictures only */
|
||||
guint8 fieldtx;
|
||||
|
||||
/* P and B pictures */
|
||||
guint8 intcomp;
|
||||
guint8 dmvrange;
|
||||
guint8 mbmodetab;
|
||||
guint8 imvtab;
|
||||
guint8 icbptab;
|
||||
guint8 mvbptab2;
|
||||
guint8 mvbptab4; /* If 4mvswitch in ppic */
|
||||
|
||||
/* P picture */
|
||||
guint8 mvswitch4;
|
||||
|
||||
/* For interlaced fields only */
|
||||
guint16 refdist;
|
||||
guint8 fptype; /* Raw value */
|
||||
|
||||
/* P pic */
|
||||
guint8 numref;
|
||||
guint8 reffield;
|
||||
guint8 lumscale2;
|
||||
guint8 lumshift2;
|
||||
guint8 intcompfield;
|
||||
|
||||
};
|
||||
|
||||
struct _GstVC1BitPlanes
|
||||
{
|
||||
guint8 *acpred;
|
||||
guint8 *fieldtx;
|
||||
guint8 *overflags;
|
||||
guint8 *mvtypemb;
|
||||
guint8 *skipmb;
|
||||
guint8 *directmb;
|
||||
guint8 *forwardmb;
|
||||
|
||||
guint size; /* Size of the arrays */
|
||||
};
|
||||
|
||||
struct _GstVC1VopDquant
|
||||
{
|
||||
guint8 pqdiff;
|
||||
guint8 abspq;
|
||||
|
||||
/* Computed */
|
||||
guint8 altpquant;
|
||||
|
||||
/* if dqant != 2*/
|
||||
guint8 dquantfrm;
|
||||
|
@ -397,6 +498,18 @@ struct _GstVC1VopDquant
|
|||
|
||||
};
|
||||
|
||||
struct _GstVC1FrameLayer
|
||||
{
|
||||
guint8 key;
|
||||
guint32 framesize;
|
||||
|
||||
guint32 timestamp;
|
||||
|
||||
/* calculated */
|
||||
guint32 next_framelayer_offset;
|
||||
guint8 skiped_p_frame;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVC1FrameHdr:
|
||||
*
|
||||
|
@ -407,7 +520,7 @@ struct _GstVC1VopDquant
|
|||
struct _GstVC1FrameHdr
|
||||
{
|
||||
/* common fields */
|
||||
guint8 ptype;
|
||||
GstVC1PictureType ptype;
|
||||
guint8 interpfrm;
|
||||
guint8 halfqp;
|
||||
guint8 transacfrm;
|
||||
|
@ -429,6 +542,9 @@ struct _GstVC1FrameHdr
|
|||
GstVC1PicSimpleMain simple;
|
||||
GstVC1PicAdvanced advanced;
|
||||
} pic;
|
||||
|
||||
/* Size of the picture layer in bits */
|
||||
guint header_size;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -445,23 +561,61 @@ struct _GstVC1BDU
|
|||
guint8 * data;
|
||||
};
|
||||
|
||||
GstVC1ParseResult gst_vc1_identify_next_bdu (const guint8 *data,
|
||||
GstVC1ParserResult gst_vc1_identify_next_bdu (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1BDU *bdu);
|
||||
|
||||
|
||||
GstVC1ParseResult gst_vc1_parse_sequence_header (const guint8 *data,
|
||||
GstVC1ParserResult gst_vc1_parse_sequence_header (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1SeqHdr * seqhdr);
|
||||
|
||||
GstVC1ParseResult gst_vc1_parse_entry_point_header (const guint8 *data,
|
||||
GstVC1ParserResult gst_vc1_parse_entry_point_header (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1EntryPointHdr * entrypoint,
|
||||
GstVC1SeqHdr *seqhdr);
|
||||
|
||||
GstVC1ParseResult gst_vc1_parse_frame_header (const guint8 *data,
|
||||
GstVC1ParserResult gst_vc1_parse_sequence_layer (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1SeqLayer * seqlayer);
|
||||
|
||||
GstVC1ParserResult
|
||||
gst_vc1_parse_sequence_header_struct_a (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1SeqStructA *structa);
|
||||
GstVC1ParserResult
|
||||
gst_vc1_parse_sequence_header_struct_b (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1SeqStructB *structb);
|
||||
|
||||
GstVC1ParserResult
|
||||
gst_vc1_parse_sequence_header_struct_c (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1SeqStructC *structc);
|
||||
|
||||
GstVC1ParserResult gst_vc1_parse_frame_layer (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1FrameLayer * framelayer);
|
||||
|
||||
GstVC1ParserResult gst_vc1_parse_frame_header (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1FrameHdr * framehdr,
|
||||
GstVC1SeqHdr *seqhdr,
|
||||
GstVC1BitPlanes *bitplanes);
|
||||
|
||||
GstVC1ParserResult gst_vc1_parse_field_header (const guint8 *data,
|
||||
gsize size,
|
||||
GstVC1FrameHdr * fieldhdr,
|
||||
GstVC1SeqHdr *seqhdr,
|
||||
GstVC1BitPlanes *bitplanes);
|
||||
|
||||
GstVC1BitPlanes * gst_vc1_bitplanes_new (void);
|
||||
|
||||
void gst_vc1_bitplanes_free (GstVC1BitPlanes *bitplanes);
|
||||
|
||||
void gst_vc1_bitplanes_free_1 (GstVC1BitPlanes *bitplanes);
|
||||
|
||||
gboolean gst_vc1_bitplanes_ensure_size (GstVC1BitPlanes *bitplanes,
|
||||
GstVC1SeqHdr *seqhdr);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -624,8 +624,7 @@ gst_h264_parse_check_valid_frame (GstBaseParse * parse,
|
|||
"current offset: %u, Nal offset: %u, Nal Size: %u",
|
||||
current_off, nalu.offset, nalu.size);
|
||||
|
||||
current_off = nalu.offset + nalu.size;
|
||||
GST_DEBUG_OBJECT (h264parse, "current off. %u, %u", current_off,
|
||||
GST_DEBUG_OBJECT (h264parse, "current off. %u",
|
||||
nalu.offset + nalu.size);
|
||||
if (!h264parse->nalu.size && !h264parse->nalu.valid)
|
||||
h264parse->nalu = nalu;
|
||||
|
@ -1257,9 +1256,9 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
|
|||
off = nalu.offset + nalu.size;
|
||||
}
|
||||
|
||||
num_pps = data[0];
|
||||
data++;
|
||||
size++;
|
||||
num_pps = data[off];
|
||||
off++;
|
||||
|
||||
for (i = 0; i < num_pps; i++) {
|
||||
parseres = gst_h264_parser_identify_nalu_avc (h264parse->nalparser,
|
||||
data, off, size, 2, &nalu);
|
||||
|
@ -1314,7 +1313,7 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
|
|||
/* ERRORS */
|
||||
avcc_too_small:
|
||||
{
|
||||
GST_DEBUG_OBJECT (h264parse, "avcC size %u < 7", size);
|
||||
GST_DEBUG_OBJECT (h264parse, "avcC size %u < 8", size);
|
||||
goto refuse_caps;
|
||||
}
|
||||
wrong_version:
|
||||
|
|
|
@ -786,7 +786,7 @@ static guint8 pframe2_adv[] = {
|
|||
|
||||
GST_START_TEST (test_vc1_identify_bdu)
|
||||
{
|
||||
GstVC1ParseResult res;
|
||||
GstVC1ParserResult res;
|
||||
GstVC1BDU bdu;
|
||||
GstVC1SeqHdr hdr;
|
||||
GstVC1EntryPointHdr entrypt;
|
||||
|
@ -799,10 +799,10 @@ GST_START_TEST (test_vc1_identify_bdu)
|
|||
|
||||
res = gst_vc1_parse_sequence_header (bdu.data + bdu.offset, bdu.size, &hdr);
|
||||
assert_equals_int (res, GST_VC1_PARSER_OK);
|
||||
assert_equals_int (hdr.profiletype, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (hdr.profile, GST_VC1_PROFILE_ADVANCED);
|
||||
|
||||
assert_equals_int (hdr.profile.advanced.level, GST_VC1_LEVEL_L1);
|
||||
assert_equals_int (hdr.colordiff_format, 1);
|
||||
assert_equals_int (hdr.advanced.level, GST_VC1_LEVEL_L1);
|
||||
assert_equals_int (hdr.advanced.colordiff_format, 1);
|
||||
|
||||
res = gst_vc1_identify_next_bdu (sequence_fullframe + bdu.sc_offset +
|
||||
bdu.size, sizeof (sequence_fullframe) - bdu.sc_offset - bdu.size, &bdu);
|
||||
|
@ -822,32 +822,32 @@ GST_START_TEST (test_vc1_parse_p_frame_header_main)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1SimpleMainSeqHdr *simplehdr = &seqhdr.profile.simplemain;
|
||||
GstVC1SeqStructC *structc = &seqhdr.struct_c;
|
||||
GstVC1PicSimpleMain *pic = &framehdr.pic.simple;
|
||||
|
||||
structc->coded_height = 240;
|
||||
structc->coded_width = 320;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (pframe_header_main,
|
||||
sizeof (pframe_header_main), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_MAIN);
|
||||
|
||||
simplehdr->coded_height = 240;
|
||||
simplehdr->coded_width = 320;
|
||||
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 2);
|
||||
assert_equals_int (simplehdr->loop_filter, 1);
|
||||
assert_equals_int (simplehdr->multires, 0);
|
||||
assert_equals_int (simplehdr->extended_mv, 0);
|
||||
assert_equals_int (simplehdr->rangered, 0);
|
||||
assert_equals_int (simplehdr->vstransform, 1);
|
||||
assert_equals_int (simplehdr->overlap, 1);
|
||||
assert_equals_int (simplehdr->syncmarker, 0);
|
||||
assert_equals_int (simplehdr->dquant, 1);
|
||||
assert_equals_int (simplehdr->quantizer, 0);
|
||||
assert_equals_int (simplehdr->maxbframes, 1);
|
||||
assert_equals_int (structc->frmrtq_postproc, 7);
|
||||
assert_equals_int (structc->bitrtq_postproc, 2);
|
||||
assert_equals_int (structc->loop_filter, 1);
|
||||
assert_equals_int (structc->multires, 0);
|
||||
assert_equals_int (structc->extended_mv, 0);
|
||||
assert_equals_int (structc->rangered, 0);
|
||||
assert_equals_int (structc->vstransform, 1);
|
||||
assert_equals_int (structc->overlap, 1);
|
||||
assert_equals_int (structc->syncmarker, 0);
|
||||
assert_equals_int (structc->dquant, 1);
|
||||
assert_equals_int (structc->quantizer, 0);
|
||||
assert_equals_int (structc->maxbframes, 1);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (pframe_main,
|
||||
sizeof (pframe_main), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (pframe_main), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_P);
|
||||
assert_equals_int (framehdr.interpfrm, 0);
|
||||
assert_equals_int (pic->frmcnt, 1);
|
||||
|
@ -865,33 +865,40 @@ GST_START_TEST (test_vc1_parse_b_frame_header_main)
|
|||
{
|
||||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
GstVC1BitPlanes b = { 0, };
|
||||
|
||||
GstVC1SimpleMainSeqHdr *simplehdr = &seqhdr.profile.simplemain;
|
||||
GstVC1SeqStructC *structc = &seqhdr.struct_c;
|
||||
GstVC1PicSimpleMain *pic = &framehdr.pic.simple;
|
||||
|
||||
structc->coded_height = 240;
|
||||
structc->coded_width = 320;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (bframe_header_main,
|
||||
sizeof (bframe_header_main), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (seqhdr.mb_height, 15);
|
||||
assert_equals_int (seqhdr.mb_width, 20);
|
||||
|
||||
simplehdr->coded_height = 240;
|
||||
simplehdr->coded_width = 320;
|
||||
gst_vc1_bitplanes_ensure_size (&b, &seqhdr);
|
||||
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 3);
|
||||
assert_equals_int (simplehdr->loop_filter, 1);
|
||||
assert_equals_int (simplehdr->multires, 0);
|
||||
assert_equals_int (simplehdr->extended_mv, 0);
|
||||
assert_equals_int (simplehdr->rangered, 0);
|
||||
assert_equals_int (simplehdr->vstransform, 1);
|
||||
assert_equals_int (simplehdr->overlap, 1);
|
||||
assert_equals_int (simplehdr->syncmarker, 0);
|
||||
assert_equals_int (simplehdr->dquant, 1);
|
||||
assert_equals_int (simplehdr->quantizer, 0);
|
||||
assert_equals_int (simplehdr->maxbframes, 1);
|
||||
assert_equals_int (b.size, 315);
|
||||
|
||||
assert_equals_int (structc->frmrtq_postproc, 7);
|
||||
assert_equals_int (structc->bitrtq_postproc, 3);
|
||||
assert_equals_int (structc->loop_filter, 1);
|
||||
assert_equals_int (structc->multires, 0);
|
||||
assert_equals_int (structc->extended_mv, 0);
|
||||
assert_equals_int (structc->rangered, 0);
|
||||
assert_equals_int (structc->vstransform, 1);
|
||||
assert_equals_int (structc->overlap, 1);
|
||||
assert_equals_int (structc->syncmarker, 0);
|
||||
assert_equals_int (structc->dquant, 1);
|
||||
assert_equals_int (structc->quantizer, 0);
|
||||
assert_equals_int (structc->maxbframes, 1);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (bframe_main,
|
||||
sizeof (bframe_main), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (bframe_main), &framehdr, &seqhdr, &b), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_B);
|
||||
assert_equals_int (framehdr.interpfrm, 0);
|
||||
|
@ -904,6 +911,8 @@ GST_START_TEST (test_vc1_parse_b_frame_header_main)
|
|||
assert_equals_int (framehdr.pquant, 7);
|
||||
assert_equals_int (framehdr.halfqp, 0);
|
||||
assert_equals_int (framehdr.pquantizer, 0);
|
||||
|
||||
gst_vc1_bitplanes_free_1 (&b);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
@ -913,30 +922,31 @@ GST_START_TEST (test_vc1_parse_bi_frame_header_main)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1SimpleMainSeqHdr *simplehdr = &seqhdr.profile.simplemain;
|
||||
GstVC1SeqStructC *structc = &seqhdr.struct_c;
|
||||
GstVC1PicSimpleMain *pic = &framehdr.pic.simple;
|
||||
simplehdr->coded_height = 240;
|
||||
simplehdr->coded_width = 320;
|
||||
|
||||
structc->coded_height = 240;
|
||||
structc->coded_width = 320;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (i_bi_frame_header,
|
||||
sizeof (i_bi_frame_header), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 7);
|
||||
assert_equals_int (simplehdr->loop_filter, 1);
|
||||
assert_equals_int (simplehdr->multires, 0);
|
||||
assert_equals_int (simplehdr->extended_mv, 0);
|
||||
assert_equals_int (simplehdr->rangered, 0);
|
||||
assert_equals_int (simplehdr->vstransform, 1);
|
||||
assert_equals_int (simplehdr->overlap, 1);
|
||||
assert_equals_int (simplehdr->syncmarker, 0);
|
||||
assert_equals_int (simplehdr->dquant, 1);
|
||||
assert_equals_int (simplehdr->quantizer, 0);
|
||||
assert_equals_int (simplehdr->maxbframes, 1);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (structc->frmrtq_postproc, 7);
|
||||
assert_equals_int (structc->bitrtq_postproc, 7);
|
||||
assert_equals_int (structc->loop_filter, 1);
|
||||
assert_equals_int (structc->multires, 0);
|
||||
assert_equals_int (structc->extended_mv, 0);
|
||||
assert_equals_int (structc->rangered, 0);
|
||||
assert_equals_int (structc->vstransform, 1);
|
||||
assert_equals_int (structc->overlap, 1);
|
||||
assert_equals_int (structc->syncmarker, 0);
|
||||
assert_equals_int (structc->dquant, 1);
|
||||
assert_equals_int (structc->quantizer, 0);
|
||||
assert_equals_int (structc->maxbframes, 1);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (biframe_main,
|
||||
sizeof (biframe_main), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (biframe_main), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_BI);
|
||||
assert_equals_int (framehdr.interpfrm, 0);
|
||||
|
||||
|
@ -955,31 +965,31 @@ GST_START_TEST (test_vc1_parse_i_frame_header_main)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1SimpleMainSeqHdr *simplehdr = &seqhdr.profile.simplemain;
|
||||
GstVC1SeqStructC *structc = &seqhdr.struct_c;
|
||||
GstVC1PicSimpleMain *pic = &framehdr.pic.simple;
|
||||
|
||||
simplehdr->coded_height = 240;
|
||||
simplehdr->coded_width = 320;
|
||||
structc->coded_height = 240;
|
||||
structc->coded_width = 320;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (i_bi_frame_header,
|
||||
sizeof (i_bi_frame_header), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 7);
|
||||
assert_equals_int (simplehdr->loop_filter, 1);
|
||||
assert_equals_int (simplehdr->multires, 0);
|
||||
assert_equals_int (simplehdr->extended_mv, 0);
|
||||
assert_equals_int (simplehdr->rangered, 0);
|
||||
assert_equals_int (simplehdr->vstransform, 1);
|
||||
assert_equals_int (simplehdr->overlap, 1);
|
||||
assert_equals_int (simplehdr->syncmarker, 0);
|
||||
assert_equals_int (simplehdr->dquant, 1);
|
||||
assert_equals_int (simplehdr->quantizer, 0);
|
||||
assert_equals_int (simplehdr->maxbframes, 1);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_MAIN);
|
||||
assert_equals_int (structc->frmrtq_postproc, 7);
|
||||
assert_equals_int (structc->bitrtq_postproc, 7);
|
||||
assert_equals_int (structc->loop_filter, 1);
|
||||
assert_equals_int (structc->multires, 0);
|
||||
assert_equals_int (structc->extended_mv, 0);
|
||||
assert_equals_int (structc->rangered, 0);
|
||||
assert_equals_int (structc->vstransform, 1);
|
||||
assert_equals_int (structc->overlap, 1);
|
||||
assert_equals_int (structc->syncmarker, 0);
|
||||
assert_equals_int (structc->dquant, 1);
|
||||
assert_equals_int (structc->quantizer, 0);
|
||||
assert_equals_int (structc->maxbframes, 1);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (iframe_main,
|
||||
sizeof (iframe_main), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (iframe_main), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_I);
|
||||
assert_equals_int (framehdr.interpfrm, 0);
|
||||
|
||||
|
@ -998,23 +1008,23 @@ GST_START_TEST (test_vc1_parse_i_frame_header_adv)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.profile.advanced;
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.advanced;
|
||||
GstVC1EntryPointHdr *entrypt = &advhdr->entrypoint;
|
||||
GstVC1PicAdvanced *pic = &framehdr.pic.advanced;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (iframe_adv_hdr,
|
||||
sizeof (iframe_adv_hdr), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (advhdr->level, GST_VC1_LEVEL_L3);
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->frmrtq_postproc, 7);
|
||||
assert_equals_int (advhdr->bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->postprocflag, 0);
|
||||
assert_equals_int (advhdr->max_coded_width, 1920);
|
||||
assert_equals_int (advhdr->max_coded_height, 1080);
|
||||
assert_equals_int (advhdr->interlace, 1);
|
||||
assert_equals_int (advhdr->tfcntrflag, 0);
|
||||
assert_equals_int (seqhdr.finterpflag, 0);
|
||||
assert_equals_int (advhdr->finterpflag, 0);
|
||||
|
||||
assert_equals_int (advhdr->display_ext, 1);
|
||||
assert_equals_int (advhdr->disp_horiz_size, 1920);
|
||||
|
@ -1038,7 +1048,7 @@ GST_START_TEST (test_vc1_parse_i_frame_header_adv)
|
|||
assert_equals_int (entrypt->coded_width, 1920);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (iframe_adv,
|
||||
sizeof (iframe_adv), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (iframe_adv), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_I);
|
||||
assert_equals_int (framehdr.pqindex, 3);
|
||||
|
@ -1059,23 +1069,23 @@ GST_START_TEST (test_vc1_parse_b_frame_header_adv)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.profile.advanced;
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.advanced;
|
||||
GstVC1EntryPointHdr *entrypt = &advhdr->entrypoint;
|
||||
GstVC1PicAdvanced *pic = &framehdr.pic.advanced;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (iframe_adv_hdr,
|
||||
sizeof (iframe_adv_hdr), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (advhdr->level, GST_VC1_LEVEL_L3);
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->frmrtq_postproc, 7);
|
||||
assert_equals_int (advhdr->bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->postprocflag, 0);
|
||||
assert_equals_int (advhdr->max_coded_width, 1920);
|
||||
assert_equals_int (advhdr->max_coded_height, 1080);
|
||||
assert_equals_int (advhdr->interlace, 1);
|
||||
assert_equals_int (advhdr->tfcntrflag, 0);
|
||||
assert_equals_int (seqhdr.finterpflag, 0);
|
||||
assert_equals_int (advhdr->finterpflag, 0);
|
||||
|
||||
assert_equals_int (advhdr->display_ext, 1);
|
||||
assert_equals_int (advhdr->disp_horiz_size, 1920);
|
||||
|
@ -1097,7 +1107,7 @@ GST_START_TEST (test_vc1_parse_b_frame_header_adv)
|
|||
assert_equals_int (entrypt->quantizer, 0);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (bframe_adv,
|
||||
sizeof (bframe_adv), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (bframe_adv), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_B);
|
||||
assert_equals_int (framehdr.pqindex, 1);
|
||||
|
@ -1109,7 +1119,7 @@ GST_START_TEST (test_vc1_parse_b_frame_header_adv)
|
|||
assert_equals_int (framehdr.transacfrm, 1);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (bframe2_adv,
|
||||
sizeof (bframe2_adv), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (bframe2_adv), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_B);
|
||||
assert_equals_int (framehdr.pqindex, 4);
|
||||
assert_equals_int (framehdr.pquant, 4);
|
||||
|
@ -1129,23 +1139,23 @@ GST_START_TEST (test_vc1_parse_p_frame_header_adv)
|
|||
GstVC1FrameHdr framehdr;
|
||||
GstVC1SeqHdr seqhdr;
|
||||
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.profile.advanced;
|
||||
GstVC1AdvancedSeqHdr *advhdr = &seqhdr.advanced;
|
||||
GstVC1EntryPointHdr *entrypt = &advhdr->entrypoint;
|
||||
GstVC1PicAdvanced *pic = &framehdr.pic.advanced;
|
||||
|
||||
assert_equals_int (gst_vc1_parse_sequence_header (iframe_adv_hdr,
|
||||
sizeof (iframe_adv_hdr), &seqhdr), GST_VC1_PARSER_OK);
|
||||
|
||||
assert_equals_int (seqhdr.profiletype, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (seqhdr.profile, GST_VC1_PROFILE_ADVANCED);
|
||||
assert_equals_int (advhdr->level, GST_VC1_LEVEL_L3);
|
||||
assert_equals_int (seqhdr.frmrtq_postproc, 7);
|
||||
assert_equals_int (seqhdr.bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->frmrtq_postproc, 7);
|
||||
assert_equals_int (advhdr->bitrtq_postproc, 31);
|
||||
assert_equals_int (advhdr->postprocflag, 0);
|
||||
assert_equals_int (advhdr->max_coded_width, 1920);
|
||||
assert_equals_int (advhdr->max_coded_height, 1080);
|
||||
assert_equals_int (advhdr->interlace, 1);
|
||||
assert_equals_int (advhdr->tfcntrflag, 0);
|
||||
assert_equals_int (seqhdr.finterpflag, 0);
|
||||
assert_equals_int (advhdr->finterpflag, 0);
|
||||
|
||||
assert_equals_int (advhdr->display_ext, 1);
|
||||
assert_equals_int (advhdr->disp_horiz_size, 1920);
|
||||
|
@ -1169,7 +1179,7 @@ GST_START_TEST (test_vc1_parse_p_frame_header_adv)
|
|||
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (pframe_adv,
|
||||
sizeof (pframe_adv), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (pframe_adv), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_P);
|
||||
assert_equals_int (framehdr.pqindex, 1);
|
||||
assert_equals_int (framehdr.pquant, 1);
|
||||
|
@ -1180,7 +1190,7 @@ GST_START_TEST (test_vc1_parse_p_frame_header_adv)
|
|||
assert_equals_int (pic->mvrange, 0);
|
||||
|
||||
assert_equals_int (gst_vc1_parse_frame_header (pframe2_adv,
|
||||
sizeof (pframe2_adv), &framehdr, &seqhdr), GST_VC1_PARSER_OK);
|
||||
sizeof (pframe2_adv), &framehdr, &seqhdr, NULL), GST_VC1_PARSER_OK);
|
||||
assert_equals_int (framehdr.ptype, GST_VC1_PICTURE_TYPE_P);
|
||||
assert_equals_int (framehdr.pqindex, 1);
|
||||
assert_equals_int (framehdr.pquant, 1);
|
||||
|
|
Loading…
Reference in a new issue