]> granicus.if.org Git - libx264/commitdiff
Correctly mark output frames as BREF
authorFiona Glaser <fiona@x264.com>
Tue, 6 Apr 2010 20:53:22 +0000 (13:53 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 6 Apr 2010 20:53:22 +0000 (13:53 -0700)
Simplify pic_out code.

encoder/encoder.c

index e87f228e9182d3e1455168c52aa6cfb03955b72d..9372d3399003179328849c57478510c924870a86 100644 (file)
@@ -2485,8 +2485,6 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         return 0;
     }
 
-    x264_frame_push_unused( thread_current, h->fenc );
-
     x264_emms();
     /* generate sei buffering period and insert it into place */
     if( h->fenc->b_keyframe && h->sps->vui.b_nal_hrd_parameters_present )
@@ -2511,12 +2509,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
     int frame_size = x264_encoder_encapsulate_nals( h, 0 );
 
     /* Set output picture properties */
-    if( h->sh.i_type == SLICE_TYPE_I )
-        pic_out->i_type = h->i_nal_type == NAL_SLICE_IDR ? X264_TYPE_IDR : X264_TYPE_I;
-    else if( h->sh.i_type == SLICE_TYPE_P )
-        pic_out->i_type = X264_TYPE_P;
-    else
-        pic_out->i_type = X264_TYPE_B;
+    pic_out->i_type = h->fenc->i_type;
 
     pic_out->b_keyframe = h->fenc->b_keyframe;
 
@@ -2552,6 +2545,8 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         pic_out->img.plane[i] = h->fdec->plane[i];
     }
 
+    x264_frame_push_unused( thread_current, h->fenc );
+
     /* ---------------------- Update encoder state ------------------------- */
 
     /* update rc */