[x264-devel] commit: add AltiVec implementation of x264_pixel_var_16x16 and x264_pixel_var_8x8 (Guillaume Poirier )

Jason Garrett-Glaser darkshikari at gmail.com
Mon Jan 26 18:09:21 CET 2009


On Mon, Jan 26, 2009 at 5:49 AM, Guillaume POIRIER
<gpoirier at mplayerhq.hu> wrote:
> Hello,
>
> On Mon, Jan 26, 2009 at 12:12 AM, Jason Garrett-Glaser
> <darkshikari at gmail.com> wrote:
>
>> You also need to replace luma_plane_size/4 with chroma_plane_size
>> accordingly (make a new variable).
>
> Like this?
>
> diff --git a/common/frame.c b/common/frame.c
> index a51dc29..0ad2360 100644
> --- a/common/frame.c
> +++ b/common/frame.c
> @@ -35,6 +35,7 @@ x264_frame_t *x264_frame_new( x264_t *h )
>     int i_stride, i_width, i_lines;
>     int i_padv = PADV << h->param.b_interlaced;
>     int luma_plane_size;
> +    int chroma_plane_size;
>     int align = h->param.cpu&X264_CPU_CACHELINE_64 ? 64 :
> h->param.cpu&X264_CPU_CACHELINE_32 ? 32 : 16;
>
>     if( !frame ) return NULL;
> @@ -49,15 +50,16 @@ x264_frame_t *x264_frame_new( x264_t *h )
>     frame->i_plane = 3;
>     for( i = 0; i < 3; i++ )
>     {
> -        frame->i_stride[i] = i_stride >> !!i;
> +        frame->i_stride[i] = ALIGN( i_stride >> !!i, 16 );
>         frame->i_width[i] = i_width >> !!i;
>         frame->i_lines[i] = i_lines >> !!i;
>     }
>
>     luma_plane_size = (frame->i_stride[0] * ( frame->i_lines[0] + 2*i_padv ));
> +    chroma_plane_size = ALIGN( luma_plane_size/4, 16);

You have to actually set chroma_plane_size to the correct size, you
know.  You've changed the stride, so you have to change your math to
calculate the stride:

chroma_plane_size = (frame->i_stride[1] * ( frame->i_lines[1] +
2*i_padv )); should do the job, I think.

Dark Shikari


More information about the x264-devel mailing list