Mercurial > libavcodec.hg
changeset 5172:60a4f209838b libavcodec
Decouple bit context from h264 context in decode_ref_pic_marking()
(done in order to implement slice-level parallel decoding)
Patch by Andreas ªÓman % andreas olebyn nu %
Original thread:
Date: Jun 15, 2007 10:10 PM
Subject: [FFmpeg-devel] [PATCH] h264 parallelized, (was: Parallelized h264 proof-of-concept)
author | gpoirier |
---|---|
date | Tue, 19 Jun 2007 21:34:04 +0000 |
parents | b3fd384aaa28 |
children | 3c321b5d5c61 |
files | h264.c |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/h264.c Tue Jun 19 21:14:19 2007 +0000 +++ b/h264.c Tue Jun 19 21:34:04 2007 +0000 @@ -4006,13 +4006,13 @@ 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 @@ 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; i<MAX_MMCO_COUNT; i++) { - MMCOOpcode opcode= get_ue_golomb(&s->gb);; + 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<<h->sps.log2_max_frame_num)-1); //FIXME fields + h->mmco[i].short_frame_num= (h->frame_num - get_ue_golomb(gb) - 1) & ((1<<h->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 @@ 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);