[FFmpeg-cvslog] r19977 - in trunk: configure libavcodec/libx264.c

Dominik 'Rathann' Mierzejewski dominik
Wed Sep 23 12:07:16 CEST 2009


On Wednesday, 23 September 2009 at 11:03, darkshikari wrote:
> Author: darkshikari
> Date: Wed Sep 23 11:03:26 2009
> New Revision: 19977
> 
> Log:
> Add support for new x264 API.

You're mixing in some cosmetic changes, which AFAIK
is forbidden by SVN policy.

> Modified: trunk/libavcodec/libx264.c
> ==============================================================================
> --- trunk/libavcodec/libx264.c	Wed Sep 23 10:35:29 2009	(r19976)
> +++ trunk/libavcodec/libx264.c	Wed Sep 23 11:03:26 2009	(r19977)
> @@ -52,16 +52,14 @@ X264_log(void *p, int level, const char 
>  }
>  
>  
> -static int
> -encode_nals(AVCodecContext *ctx, uint8_t *buf, int size, x264_nal_t *nals, int nnal, int skip_sei)
> +static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size, x264_nal_t *nals, int nnal, int skip_sei)

Here.

>  {
>      X264Context *x4 = ctx->priv_data;
>      uint8_t *p = buf;
> -    int i, s;
> +    int i;
>  
>      /* Write the SEI as part of the first frame. */
> -    if(x4->sei_size > 0 && nnal > 0)
> -    {
> +    if(x4->sei_size > 0 && nnal > 0){

Here.

>          memcpy(p, x4->sei, x4->sei_size);
>          p += x4->sei_size;
>          x4->sei_size = 0;
> @@ -69,17 +67,14 @@ encode_nals(AVCodecContext *ctx, uint8_t
>  
>      for(i = 0; i < nnal; i++){
>          /* Don't put the SEI in extradata. */
> -        if(skip_sei && nals[i].i_type == NAL_SEI)
> -        {
> -            x4->sei = av_malloc( 5 + nals[i].i_payload * 4 / 3 );
> -            if(x264_nal_encode(x4->sei, &x4->sei_size, 1, nals + i) < 0)
> -                return -1;
> +        if(skip_sei && nals[i].i_type == NAL_SEI){

Here.

> +            x4->sei_size = nals[i].i_payload;
> +            x4->sei = av_malloc(x4->sei_size);
> +            memcpy(x4->sei, nals[i].p_payload, nals[i].i_payload);
>              continue;
>          }
> -        s = x264_nal_encode(p, &size, 1, nals + i);
> -        if(s < 0)
> -            return -1;
> -        p += s;
> +        memcpy(p, nals[i].p_payload, nals[i].i_payload);
> +        p += nals[i].i_payload;
>      }
>  
>      return p - buf;
> @@ -97,7 +92,7 @@ X264_frame(AVCodecContext *ctx, uint8_t 
>      x4->pic.img.i_csp = X264_CSP_I420;
>      x4->pic.img.i_plane = 3;
>  
> -    if (frame) {
> +    if(frame){

And here.

Regards,
R.

-- 
MPlayer http://mplayerhq.hu | RPMFusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan



More information about the ffmpeg-cvslog mailing list