Skip to main content

 none
About the brightness adjust by SSE2 RRS feed

  • Question

  • Now I want to adjust the brightness through SSE2, the following code doesn't work.

            BYTE b = abs(m_nBrightness);

    __int64  c = m_nBrightness;

    for ( int i = 1; i <= 7; i++ )

    {

    c = c << 8;

    c |= b;

    }

    int nNumberOfLoops = nSize / 16;

    __m128i* pIn = (__m128i*) pBuffer;          

     

    __m128i tmp;                              

     

    __m64 m;

    m.m64_u64 = c;

     

    __m128i nChange64 =_mm_set1_epi64 (m);

     

    if(m_nBrightness>0)

    {

    for (int i = 0; i < nNumberOfLoops; i++ )

    {

    tmp = _mm_add_epi64  (*pIn, nChange64); 

    *pIn++= tmp;

    }

    }

    else

    {

    for (int i = 0; i < nNumberOfLoops; i++ )

    {

    tmp = _mm_sub_epi64   (*pIn, nChange64); 

     

    *pIn++= tmp;

    }

    }


    video edit
    Monday, October 11, 2010 8:54 AM

All replies

  • Hello,

    If your asking what's wrong with the code ou may want to consider openeing an advisory case with Microsoft. 

    If yourstating that there is some issue with the compiler intrinsic functions our using (_mm_set1_epi64) then there needs to be some sort of problem statement. e. g. I put data 'x' in and get 'y' out but expected 'z'. And the problem needs to be more narrowly scoped to just an intrinsic call.

    You may want to open a paid support incident with Microsoft support, and see

    if we can't get a repro they can debug. You may have a few options for opening said support

    incident.

    Alliance and Premier VSIP membership includes a complimentary MSDN subscription, which includes 4

    professional support incidents. These can be used to initialize a support request with Microsoft's

    Customer Support Services. Some versions of Visual Studio include a number of free support incidents

    as well. See the "Technical Support Incidents" topic for details.

     


    visit the below link to see the various paid support options that are available to better meet your

    needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Friday, October 15, 2010 7:56 PM
    Moderator