From 995a30c06bc04045eeeea5aa7d987cd33fd1fcfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 19 Jun 2007 21:34:04 +0000 Subject: [PATCH] =?UTF-8?q?Decouple=20bit=20context=20from=20h264=20contex?= =?UTF-8?q?t=20in=20decode=5Fref=5Fpic=5Fmarking()=20(done=20in=20order=20?= =?UTF-8?q?to=20implement=20slice-level=20parallel=20decoding)=20Patch=20b?= =?UTF-8?q?y=20Andreas=20=C3=96man=20%=20andreas=20olebyn=20nu=20%=20Origi?= =?UTF-8?q?nal=20thread:=20Date:=20Jun=2015,=202007=2010:10=20PM=20Subject?= =?UTF-8?q?:=20[FFmpeg-devel]=20[PATCH]=20h264=20parallelized,=20(was:=20P?= =?UTF-8?q?arallelized=20h264=20proof-of-concept)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 9371 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 9930624824..a8801a1817 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4006,13 +4006,13 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ return 0; } -static int decode_ref_pic_marking(H264Context *h){ +static int decode_ref_pic_marking(H264Context *h, GetBitContext *gb){ MpegEncContext * const s = &h->s; int i; if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields - s->broken_link= get_bits1(&s->gb) -1; - h->mmco[0].long_index= get_bits1(&s->gb) - 1; // current_long_term_idx + s->broken_link= get_bits1(gb) -1; + h->mmco[0].long_index= get_bits1(gb) - 1; // current_long_term_idx if(h->mmco[0].long_index == -1) h->mmco_index= 0; else{ @@ -4020,20 +4020,20 @@ static int decode_ref_pic_marking(H264Context *h){ h->mmco_index= 1; } }else{ - if(get_bits1(&s->gb)){ // adaptive_ref_pic_marking_mode_flag + if(get_bits1(gb)){ // adaptive_ref_pic_marking_mode_flag for(i= 0; igb);; + MMCOOpcode opcode= get_ue_golomb(gb); h->mmco[i].opcode= opcode; if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){ - h->mmco[i].short_frame_num= (h->frame_num - get_ue_golomb(&s->gb) - 1) & ((1<sps.log2_max_frame_num)-1); //FIXME fields + h->mmco[i].short_frame_num= (h->frame_num - get_ue_golomb(gb) - 1) & ((1<sps.log2_max_frame_num)-1); //FIXME fields /* if(h->mmco[i].short_frame_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_frame_num ] == NULL){ av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco); return -1; }*/ } if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){ - unsigned int long_index= get_ue_golomb(&s->gb); + unsigned int long_index= get_ue_golomb(gb); if(/*h->mmco[i].long_index >= h->long_ref_count || h->long_ref[ h->mmco[i].long_index ] == NULL*/ long_index >= 16){ av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode); return -1; @@ -4416,7 +4416,7 @@ static int decode_slice_header(H264Context *h){ h->use_weight = 0; if(s->current_picture.reference) - decode_ref_pic_marking(h); + decode_ref_pic_marking(h, &s->gb); if(FRAME_MBAFF) fill_mbaff_ref_list(h);