[x264-devel] The csp order should be same in the project x264.

alexander tian tian.alexandertian at gmail.com
Fri Dec 2 09:51:20 CET 2011


Hi, BugMaster

I found the resson for error message. Because I compile the project by
vs2005 I change the structure "x264_cli_csps" from
const x264_cli_csp_t x264_cli_csps[] = {
    [X264_CSP_I420] = { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
    [X264_CSP_I422] = { "i422", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
    [X264_CSP_I444] = { "i444", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
    [X264_CSP_YV12] = { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
    [X264_CSP_YV16] = { "yv16", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
    [X264_CSP_YV24] = { "yv24", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
    [X264_CSP_NV12] = { "nv12", 2, { 1,  1 },     { 1, .5 },     2, 2 },
    [X264_CSP_NV16] = { "nv16", 2, { 1,  1 },     { 1,  1 },     2, 1 },
    [X264_CSP_BGR]  = { "bgr",  1, { 3 },         { 1 },         1, 1 },
    [X264_CSP_BGRA] = { "bgra", 1, { 4 },         { 1 },         1, 1 },
    [X264_CSP_RGB]  = { "rgb",  1, { 3 },         { 1 },         1, 1 },
};

to

const x264_cli_csp_t x264_cli_csps[] = {
    { "", 0, { 0 }, { 0 }, 0, 0 },//[0]
    { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },//[X264_CSP_I420]
    { "i422", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },//[X264_CSP_I422]
    { "i444", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },//[X264_CSP_I444]
    { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },//[X264_CSP_YV12]
      { "yv16", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },//[X264_CSP_YV16]
      { "yv24", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },//[X264_CSP_YV24]
    { "nv12", 2, { 1,  1 },     { 1, .5 },     2, 2 },//[X264_CSP_NV12]
      { "nv16", 2, { 1,  1 },     { 1,  1 },     2, 1 },//[X264_CSP_NV16]
    { "bgr",  1, { 3 },         { 1 },         1, 1 },//[X264_CSP_BGR]
    { "bgra", 1, { 4 },         { 1 },         1, 1 },//[X264_CSP_BGRA]
    { "rgb",  1, { 3 },         { 1 },         1, 1 }//[X264_CSP_RGB]
};

Here is wrong. The origin index corresponds to the index of name
"X264_CSP_*". The new index becomes "0,1,2....,11" after changed. The index
of csp "i422" becomes 2 from 4. The exact change in vs2005 as blows:

const x264_cli_csp_t x264_cli_csps[] = {
    { "", 0, { 0 }, { 0 }, 0, 0 },//[0]
    { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },//[X264_CSP_I420]
    { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },//[X264_CSP_YV12]
    { "nv12", 2, { 1,  1 },     { 1, .5 },     2, 2 },//[X264_CSP_NV12]
    { "i422", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },//[X264_CSP_I422]
    { "yv16", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },//[X264_CSP_YV16]
    { "nv16", 2, { 1,  1 },     { 1,  1 },     2, 1 },//[X264_CSP_NV16]
    { "i444", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },//[X264_CSP_I444]
    { "yv24", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },//[X264_CSP_YV24]
    { "bgr",  1, { 3 },         { 1 },         1, 1 },//[X264_CSP_BGR]
    { "bgra", 1, { 4 },         { 1 },         1, 1 },//[X264_CSP_BGRA]
    { "rgb",  1, { 3 },         { 1 },         1, 1 }//[X264_CSP_RGB]
};

All things wrong because of my misplay. Here is nothing about libswscale. I
amy sorry to waste your ti. Thank you very much!

Tian

2011/12/2 BugMaster <BugMaster at narod.ru>

> On Thu, 1 Dec 2011 18:04:18 +0800, alexander tian wrote:
> > Hi everyone
>
> > I want to encode profile high422 for I422 colorspace today. I use
> > the program which "X264_BUILD" is 118. I set the parameters
> > "input-csp" and "output-csp" all to "i422". But the program stopped
> > and return the message that "resize [error]: not compiled with swscale
> support".
>
> > My encoding parameters as belows:
> > --nal-hrd cbr --pic-struct --tff --profile high422 --level 4.0
> > --weightp 0 --muxer raw --demuxer raw --input-csp i422 --input-res
> > 720x576 --input-depth 8 --output-csp i422  --rc-lookahead 40
> > --slices 1 --aq-mode 1 --aq-strength 1.0 --b-pyramid none --8x8dct
> > --mvrange-thread 576 --qcomp 0.1 --ratetol 1.0 --ipratio 1.4
> > --pbratio 1.3 --bitrate 2000 --vbv-maxrate 2000 --vbv-bufsize 2000
> > --vbv-init 0.5 --keyint 25 --ref 1 --no-fast-pskip --no-dct-decimate
> > --bframe 2 --b-adapt 2 --psy-rd 1.0:0.0 --direct spatial --filter
> > 0,0 --subme 6 --trellis 1 --analyse p8x8,p4x4,b8x8,i8x8,i4x4 --me
> > hex --seek 0 --frames 250 --threads 0 --log-level error -o
> > G:\auto_422_field_20111128_cbr_framethread.264
> > H:\Samples\YUV\SD\auto_422.yuv 720x576
>
> > I trace the program. At last I find that althought I set
> > "input-csp" and "output-csp" to "i422" but "output csp" equal to 4
> > and "input csp" equal to 2 in the program. So the program believes
> > it need change colorspace. Finally it returns the error message.
>
> > I think the csp order should be same in the program. So the order
> > of the structure "x264_cli_csps[]" should be same as the structure
> "x264_csp_tab[]".
>
> > I change the structure
> > "const x264_cli_csp_t x264_cli_csps[] = {
> >     [X264_CSP_I420] = { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
> >     [X264_CSP_I422] = { "i422", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
> >     [X264_CSP_I444] = { "i444", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
> >     [X264_CSP_YV12] = { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
> >     [X264_CSP_YV16] = { "yv16", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
> >     [X264_CSP_YV24] = { "yv24", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
> >     [X264_CSP_NV12] = { "nv12", 2, { 1,  1 },     { 1, .5 },     2, 2 },
> >     [X264_CSP_NV16] = { "nv16", 2, { 1,  1 },     { 1,  1 },     2, 1 },
> >     [X264_CSP_BGR]  = { "bgr",  1, { 3 },         { 1 },         1, 1 },
> >     [X264_CSP_BGRA] = { "bgra", 1, { 4 },         { 1 },         1, 1 },
> >     [X264_CSP_RGB]  = { "rgb",  1, { 3 },         { 1 },         1, 1 },
> > };"
> > to
> > "const x264_cli_csp_t x264_cli_csps[] = {
> >     [X264_CSP_I420] = { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
> >     [X264_CSP_YV12] = { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
> >     [X264_CSP_NV12] = { "nv12", 2, { 1,  1 },     { 1, .5 },     2, 2 },
> >     [X264_CSP_I422] = { "i422", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
> >     [X264_CSP_YV16] = { "yv16", 3, { 1, .5, .5 }, { 1,  1,  1 }, 2, 1 },
> >     [X264_CSP_NV16] = { "nv16", 2, { 1,  1 },     { 1,  1 },     2, 1 },
> >     [X264_CSP_I444] = { "i444", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
> >     [X264_CSP_YV24] = { "yv24", 3, { 1,  1,  1 }, { 1,  1,  1 }, 1, 1 },
> >     [X264_CSP_BGR]  = { "bgr",  1, { 3 },         { 1 },         1, 1 },
> >     [X264_CSP_BGRA] = { "bgra", 1, { 4 },         { 1 },         1, 1 },
> >     [X264_CSP_RGB]  = { "rgb",  1, { 3 },         { 1 },         1, 1 },
> > };"
> > Then I run the program again. This time it encodes high422
> > successfully. I decode the es file by jm18.0. The decoded yuv file plays
> well.
>
> > Is my comprehension right?
> > Any suggestions are welcome! Thanks a lot!
>
> > alexander tian
>
> Hi. I doubt this have anything todo with order in x264_cli_csps
> because for every element there is explicit position constantant and
> so reodering shouldn't change real order. Also I tried your
> commandline with the current version (r2106) without swscale support
> and didn't get any errors so you probably messed up something in
> commandline first time (there are doubtful params there like
> resolution with and without --input-res) and then fixed it so all
> become correct.
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20111202/f6aea7d1/attachment-0001.html>


More information about the x264-devel mailing list