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

Guillaume POIRIER gpoirier at mplayerhq.hu
Mon Jan 26 14:49:43 CET 2009


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);
     for( i = 1; i < 3; i++ )
     {
-        CHECKED_MALLOC( frame->buffer[i], luma_plane_size/4 );
+        CHECKED_MALLOC( frame->buffer[i], chroma_plane_size );
         frame->plane[i] = frame->buffer[i] + (frame->i_stride[i] *
i_padv + PADH)/2;
     }
     /* all 4 luma planes allocated together, since the cacheline split code



I'm getting the same segfault:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000f9000
0xffff8a6c in ?? ()
(gdb) bt
#0  0xffff8a6c in ?? ()
#1  0x00013d78 in plane_expand_border (pix=0xf6b70 '' <repeats 200
times>..., i_stride=400, i_width=360, i_height=10, i_padh=16,
i_padv=16, b_pad_top=0, b_pad_bottom=1) at common/frame.c:236
#2  0x00013f50 in x264_frame_expand_border (h=0xb6000, frame=0x80c000,
mb_y=35, b_end=1) at common/frame.c:264
#3  0x0005583c in x264_fdec_filter_row (h=0xb6000, mb_y=36) at
encoder/encoder.c:1015
#4  0x0005af88 in x264_slice_write [inlined] () at encoder/encoder.c:1281
#5  0x0005af88 in x264_slices_write (h=0xb6000) at encoder/encoder.c:1331
#6  0x0005bb78 in x264_encoder_encode (h=0xb6000, pp_nal=0xbffff3f0,
pi_nal=0xbffff3f4, pic_in=0xbffff6e8, pic_out=0xbffff3b8) at
encoder/encoder.c:1595
#7  0x00002284 in Encode_frame (h=<value temporarily unavailable, due
to optimizations>, hout=0xa050a4d8, pic=<value temporarily
unavailable, due to optimizations>) at x264.c:757
#8  0x00002f78 in main (argc=<value temporarily unavailable, due to
optimizations>, argv=0x6a320) at x264.c:841


Did I missread what you wrote?

Guillaume
-- 
Only a very small fraction of our DNA does anything; the rest is all
comments and ifdefs.

P. J. O'Rourke  - "You can't get rid of poverty by giving people money."


More information about the x264-devel mailing list