aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-24 22:29:38 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-24 22:29:38 +0000
commitb78a6baaf1e25f93cae070526448d5246b31a334 (patch)
treeeea3e25c2860f09670bd8f6a85a109c1139d9796 /libavcodec
parent5710b371602774b49d432a6bd67928fb07186fe3 (diff)
downloadffmpeg-b78a6baaf1e25f93cae070526448d5246b31a334.tar.gz
Minor simplification of code in init_poc().
Originally committed as revision 14379 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 437a605cdd..209c6ecd8f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3699,10 +3699,9 @@ static int init_poc(H264Context *h){
const int max_frame_num= 1<<h->sps.log2_max_frame_num;
int field_poc[2];
+ h->frame_num_offset= h->prev_frame_num_offset;
if(h->frame_num < h->prev_frame_num)
- h->frame_num_offset= h->prev_frame_num_offset + max_frame_num;
- else
- h->frame_num_offset= h->prev_frame_num_offset;
+ h->frame_num_offset += max_frame_num;
if(h->sps.poc_type==0){
const int max_poc_lsb= 1<<h->sps.log2_max_poc_lsb;
@@ -3753,10 +3752,10 @@ static int init_poc(H264Context *h){
if(s->picture_structure == PICT_FRAME)
field_poc[1] += h->delta_poc[1];
}else{
- int poc;
+ int poc= 2*(h->frame_num_offset + h->frame_num);
- if(h->nal_ref_idc) poc= 2*(h->frame_num_offset + h->frame_num);
- else poc= 2*(h->frame_num_offset + h->frame_num) - 1;
+ if(!h->nal_ref_idc)
+ poc--;
field_poc[0]= poc;
field_poc[1]= poc;