[vlc-devel] [PATCH 2/2] x265: initialize picture and set picture type

Jean-Baptiste Kempf jb at videolan.org
Mon Oct 14 16:11:19 CEST 2013


LGTM.

On 14 Oct, Rafaël Carré wrote :
> ---
>  modules/codec/x265.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/modules/codec/x265.c b/modules/codec/x265.c
> index 8a8305f..72683a5 100644
> --- a/modules/codec/x265.c
> +++ b/modules/codec/x265.c
> @@ -70,6 +70,8 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
>      encoder_sys_t *p_sys = p_enc->p_sys;
>      x265_picture_t pic;
>  
> +    x265_picture_init(&p_sys->param, &pic);
> +
>      if (likely(p_pict)) {
>          if (unlikely(p_sys->initial_date == 0)) {
>              p_sys->initial_date = p_pict->date;
> @@ -120,6 +122,19 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
>      p_block->i_pts = p_sys->initial_date + pic.poc * p_block->i_length;
>      p_block->i_dts = p_sys->initial_date + p_sys->dts++ * p_block->i_length;
>  
> +    switch (pic.sliceType)
> +    {
> +    case X265_TYPE_I:
> +        p_block->i_flags |= BLOCK_FLAG_TYPE_I;
> +        break;
> +    case X265_TYPE_P:
> +        p_block->i_flags |= BLOCK_FLAG_TYPE_P;
> +        break;
> +    case X265_TYPE_B:
> +        p_block->i_flags |= BLOCK_FLAG_TYPE_B;
> +        break;
> +    }
> +
>  #ifndef NDEBUG
>      msg_Dbg(p_enc, "%zu bytes (frame %"PRId64", %.2ffps)", p_block->i_buffer,
>          p_sys->dts, (float)p_sys->dts * CLOCK_FREQ / (mdate() - p_sys->start));
> -- 
> 1.8.3.2
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list