summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2012-03-19 05:14:44 +0100
committerMichael Niedermayer <[email protected]>2012-03-19 05:14:44 +0100
commita3d331f2d88ec77dc60f6eb8de89e8d778cc9938 (patch)
treef69080fc46363dd2c716f32dedaf360aae2312f4 /libavcodec/h264.c
parent3a3f2b515fa54937efe1a9f0e1657c37266a98e1 (diff)
parent73ad066939bc435ba2cc47071a9dc617f8a9dda4 (diff)
Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (96 commits) intfloat_readwrite: fix signed addition overflows smacker: validate channels and sample format. smacker: check buffer size before reading output size smacker: validate number of channels sipr: fix get_bits(0) calls motion_est: make MotionExtContext.map_generation unsigned 4xm: prevent NULL dereference with invalid huffman table 4xmdemux: prevent use of uninitialized memory 4xm: clear FF_INPUT_BUFFER_PADDING_SIZE bytes in temporary buffers ptx: check for out of bound reads tiffdec: fix out of bound reads/writes eacmv: check for out of bound reads eacmv: fix potential pointer arithmetic overflows adpcm: fix out of bound reads due to integer overflow anm: prevent infinite loop avsdemux: check for out of bound writes avs: check for out of bound reads avsdemux: check for corrupted data mxfdec: Fix some buffer overreads caused by the misuse of AVPacket related functions. vaapi: Fix VC-1 decoding (reconstruct bitstream TTFRM correctly). ... Conflicts: libavcodec/adpcm.c libavcodec/bink.c libavcodec/h264.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/motion_est_template.c libavcodec/mpegvideo.c libavcodec/nellymoserdec.c libavcodec/ptx.c libavcodec/svq3.c libavcodec/vaapi_vc1.c libavcodec/xan.c libavfilter/vf_scale.c libavformat/4xm.c libavformat/flvdec.c libavformat/mpeg.c tests/ref/fate/motionpixels Merged-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c93c0ecec2..8e4b44a584 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -108,7 +108,10 @@ int ff_h264_check_intra4x4_pred_mode(H264Context *h){
return 0;
} //FIXME cleanup like check_intra_pred_mode
-static int check_intra_pred_mode(H264Context *h, int mode, int is_chroma){
+/**
+ * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
+ */
+int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma){
MpegEncContext * const s = &h->s;
static const int8_t top [7]= {LEFT_DC_PRED8x8, 1,-1,-1};
static const int8_t left[7]= { TOP_DC_PRED8x8,-1, 2,-1,DC_128_PRED8x8};
@@ -140,23 +143,6 @@ static int check_intra_pred_mode(H264Context *h, int mode, int is_chroma){
return mode;
}
-/**
- * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra16x16_pred_mode(H264Context *h, int mode)
-{
- return check_intra_pred_mode(h, mode, 0);
-}
-
-/**
- * checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
- */
-int ff_h264_check_intra_chroma_pred_mode(H264Context *h, int mode)
-{
- return check_intra_pred_mode(h, mode, 1);
-}
-
-
const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length){
int i, si, di;
uint8_t *dst;
@@ -2231,7 +2217,11 @@ static void implicit_weight_table(H264Context *h, int field){
}
if(field < 0){
- cur_poc = s->current_picture_ptr->poc;
+ if (s->picture_structure == PICT_FRAME) {
+ cur_poc = s->current_picture_ptr->poc;
+ } else {
+ cur_poc = s->current_picture_ptr->field_poc[s->picture_structure - 1];
+ }
if( h->ref_count[0] == 1 && h->ref_count[1] == 1 && !FRAME_MBAFF
&& h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){
h->use_weight= 0;
@@ -3761,7 +3751,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
case NAL_IDR_SLICE:
case NAL_SLICE:
init_get_bits(&hx->s.gb, ptr, bit_length);
- if(!get_ue_golomb(&hx->s.gb))
+ if (!get_ue_golomb(&hx->s.gb))
nals_needed = nal_index;
}
continue;