# HG changeset patch # User michael # Date 1216938578 0 # Node ID 16a60b2f7a7dc005e9ea62504264ff018f41bb72 # Parent 9faeb82ba80be73ef474633978c7c52b33392ce7 Minor simplification of code in init_poc(). diff -r 9faeb82ba80b -r 16a60b2f7a7d h264.c --- a/h264.c Thu Jul 24 22:05:58 2008 +0000 +++ b/h264.c Thu Jul 24 22:29:38 2008 +0000 @@ -3699,10 +3699,9 @@ const int max_frame_num= 1<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<sps.log2_max_poc_lsb; @@ -3753,10 +3752,10 @@ if(s->picture_structure == PICT_FRAME) field_poc[1] += h->delta_poc[1]; }else{ - int poc; - - 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; + int poc= 2*(h->frame_num_offset + h->frame_num); + + if(!h->nal_ref_idc) + poc--; field_poc[0]= poc; field_poc[1]= poc;