]> git.videolan.org Git - x264.git/commitdiff
Correctly mark output frames as BREF
authorJason Garrett-Glaser <darkshikari@gmail.com>
Tue, 6 Apr 2010 20:53:22 +0000 (13:53 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Tue, 6 Apr 2010 20:53:22 +0000 (13:53 -0700)
Simplify pic_out code.

encoder/encoder.c

index e25c9db9393d6e049d6e181dc0063865c56ace2a..829dc127ee9cfdcca0b96bea7b2085b3eafbec4d 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 */