On Sun, Jun 12, 2011 at 7:13 PM, Tristan Matthews
<[email protected]> wrote:
> 2011/6/12 Ronald S. Bultje <[email protected]>
>>
>> Hi,
>>
>> On Sun, Jun 12, 2011 at 1:56 PM, Eric Glaser <[email protected]> wrote:
>> > Hi, I am having some trouble converting from YUYV to RGB format - it
>> > crashes in sws_scale.
>>
>> Can you provide a backtrace?
>>
>> >            int numRGBBytes = ww * hh * 4;   //src width * src height * 4
>> >            buffer = malloc (sizeof(uint8_t)*numRGBBytes);
>>
>> Use av_malloc(), malloc() return values are not aligned and crash
>> randomly when using SIMD functions.
>
> libavcodec/api-example.c uses malloc in a similar context, instead of
> av_malloc. Should this be updated?
>
> -T
>
>>
>> >        int ret = sws_scale(pOGLContext->img_convert_ctx,
>> > (uint8_t**)pFrame->data, pFrame->linesize, 0, hh, pFrameRGB->data,
>> > pFrameRGB->linesize);
>>
>> So here it crashes? That's likely in the runtime-generated MMX code
>> then. Again, can you provide a backtrace, and then the output (in gdb)
>> "disass $pc-32,$pc+32" and "info all-registers".
>>
>> Ronald
>> _______________________________________________
>> libav-api mailing list
>> [email protected]
>> https://lists.libav.org/mailman/listinfo/libav-api
>
>
>
> --
> Tristan Matthews
> web: http://tristanswork.blogspot.com
>

Hi Thanks for replying.

It crashes inside libswscale function - but I noticed sometimes it
goes thru however nothing but some garbled pixels show up on the
screen. It might be my v4l reader not providing valid data. Resolution
is 720 x 576, format YUYV.

(gdb) bt
#0  0x00007ffff005d4f0 in ?? () from /usr/local/lib/libswscale.so.0
#1  0x00007ffff0060f5a in ?? () from /usr/local/lib/libswscale.so.0
#2  0x00007ffff0063987 in sws_scale () from /usr/local/lib/libswscale.so.0
...

(gdb) disass $pc-32,$pc+32
No function contains specified address.


(gdb) info all-registers
rax            0x298    664
rbx            0x7fffdc0d5af0   140736885250800
rcx            0x0      0
rdx            0x5a0    1440
rsi            0x7fffb33e1d68   140736200580456
rdi            0x7fffdc0d64e4   140736885253348
rbp            0x0      0x0
rsp            0x7fffb339b788   0x7fffb339b788
r8             0x7fffdc0183dc   140736884474844
r9             0x7fffdc0d51d8   140736885248472
r10            0x5a2    1442
r11            0x2      2
r12            0x7fffdc0203d0   140736884507600
r13            0x7fffdc09e688   140736885024392
r14            0xc7     199
r15            0xc7     199
rip            0x7ffff005d4f0   0x7ffff005d4f0
eflags         0x10283  [ CF SF IF RF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
st0            -nan(0x00000003c)        (raw 0xffff000000000000003c)
st1            -nan(0x000000004)        (raw 0xffff0000000000000004)
st2            -nan(0x000000001)        (raw 0xffff0000000000000001)
st3            -nan(0xe000000000000000) (raw 0xffffe000000000000000)
st4            0        (raw 0x00000000000000000000)
st5            0        (raw 0x00000000000000000000)
st6            -nan(0xe000000000000000) (raw 0xffffe000000000000000)
st7            -inf     (raw 0xffff0000000000000000)
fctrl          0x37f    895
fstat          0x0      0
ftag           0xffff   65535
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
xmm0           {v4_float = {0x3, 0x3, 0x3, 0x3}, v2_double = {0x20,
0x20}, v16_int8 = {0x40 <repeats 16 times>}, v8_int16 = {0x4040,
0x4040, 0x4040, 0x4040, 0x4040, 0x4040, 0x4040,
    0x4040}, v4_int32 = {0x40404040, 0x40404040, 0x40404040,
0x40404040}, v2_int64 = {0x4040404040404040, 0x4040404040404040},
uint128 = 0x40404040404040404040404040404040}
xmm1           {v4_float = {0x0, 0xd0, 0x0, 0x0}, v2_double =
{0x40000000000000, 0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x50, 0x43, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25, 0x25,
    0x25}, v8_int16 = {0x0, 0x0, 0x0, 0x4350, 0x2525, 0x2525, 0x2525,
0x2525}, v4_int32 = {0x0, 0x43500000, 0x25252525, 0x25252525},
v2_int64 = {0x4350000000000000, 0x2525252525252525},
  uint128 = 0x25252525252525254350000000000000}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0,
    0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 =
0x00000000000000000000000000000000}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double =
{0x8000000000000000, 0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
  v8_int16 = {0x0, 0x0, 0xffff, 0xffff, 0x0, 0x0, 0x0, 0x0}, v4_int32
= {0x0, 0xffffffff, 0x0, 0x0}, v2_int64 = {0xffffffff00000000, 0x0},
uint128 = 0x0000000000000000ffffffff00000000}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x30, 0x67, 0xc7, 0x93, 0x57, 0xf3, 0x2e, 0x3d, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x6730, 0x93c7, 0xf357, 0x3d2e, 0x0, 0x0, 0x0, 0x0}, v4_int32 =
{0x93c76730, 0x3d2ef357, 0x0, 0x0}, v2_int64 = {0x3d2ef35793c76730,
0x0}, uint128 = 0x00000000000000003d2ef35793c76730}
xmm5           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x1,
0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x3f, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0,
    0x0, 0x0, 0x3ff0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x3ff00000, 0x0, 0x0}, v2_int64 = {0x3ff0000000000000, 0x0}, uint128 =
0x00000000000000003ff0000000000000}
xmm6           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x1,
0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x3f, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0,
    0x0, 0x0, 0x3ff0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x3ff00000, 0x0, 0x0}, v2_int64 = {0x3ff0000000000000, 0x0}, uint128 =
0x00000000000000003ff0000000000000}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x68, 0xc8, 0xbc, 0x3b, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0,
    0x0, 0xc868, 0x3bbc, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x3bbcc868, 0x0, 0x0}, v2_int64 = {0x3bbcc86800000000, 0x0}, uint128 =
0x00000000000000003bbcc86800000000}
xmm8           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0, 0x38, 0xfa, 0xfe, 0x42, 0x2e, 0xe6, 0x3f, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x3800, 0xfefa, 0x2e42, 0x3fe6, 0x0, 0x0, 0x0, 0x0}, v4_int32 =
{0xfefa3800, 0x3fe62e42, 0x0, 0x0}, v2_int64 = {0x3fe62e42fefa3800,
0x0}, uint128 = 0x00000000000000003fe62e42fefa3800}
xmm9           {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x1,
0x0}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x3f, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0,
    0x0, 0x0, 0x3ff0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0,
0x3ff00000, 0x0, 0x0}, v2_int64 = {0x3ff0000000000000, 0x0}, uint128 =
0x00000000000000003ff0000000000000}
xmm10          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0,
    0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 =
0x00000000000000000000000000000000}
xmm11          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x30, 0x67, 0xc7, 0x93, 0x57, 0xf3, 0x2e, 0x3d, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x6730, 0x93c7, 0xf357, 0x3d2e, 0x0, 0x0, 0x0, 0x0}, v4_int32 =
{0x93c76730, 0x3d2ef357, 0x0, 0x0}, v2_int64 = {0x3d2ef35793c76730,
0x0}, uint128 = 0x00000000000000003d2ef35793c76730}
xmm12          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0,
    0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 =
0x00000000000000000000000000000000}
xmm13          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0,
    0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 =
0x00000000000000000000000000000000}
xmm14          {v4_float = {0x0, 0x1, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0, 0x38, 0xfa, 0xfe, 0x42, 0x2e, 0xe6, 0x3f, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {
    0x3800, 0xfefa, 0x2e42, 0x3fe6, 0x0, 0x0, 0x0, 0x0}, v4_int32 =
{0xfefa3800, 0x3fe62e42, 0x0, 0x0}, v2_int64 = {0x3fe62e42fefa3800,
0x0}, uint128 = 0x00000000000000003fe62e42fefa3800}
xmm15          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0,
    0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 =
0x00000000000000000000000000000000}
mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to