[x264-devel] commit: Correctly mark output frames as BREF (Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Sun Apr 11 06:50:29 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Tue Apr  6 13:53:22 2010 -0700| [058d67e3eb800d9814403876a0181874e2f900dc] | committer: Jason Garrett-Glaser 

Correctly mark output frames as BREF
Simplify pic_out code.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=058d67e3eb800d9814403876a0181874e2f900dc
---

 encoder/encoder.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index e25c9db..829dc12 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -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 */



More information about the x264-devel mailing list