YUV12源数据转BGR24

char* YV12ToBGR24(char* pYUV,char *pBGR24,int width,int height)
{
    LOGE("==YV12ToBGR24==");

    const long len = width * height;
    char* yData = pYUV;
    char* vData = &yData[len];
    char* uData = &vData[len >> 2];

    int bgr[3];
    int yIdx,uIdx,vIdx,idx;
    for (int i = 0;i < height;i++){
        for (int j = 0;j < width;j++){
            yIdx = i * width + j;
            vIdx = (i/2) * (width/2) + (j/2);
            uIdx = vIdx;

            bgr[0] = (int)(yData[yIdx] + 1.732446 * (uData[vIdx] - 128));                                    // b分量
            bgr[1] = (int)(yData[yIdx] - 0.698001 * (uData[uIdx] - 128) - 0.703125 * (vData[vIdx] - 128));    // g分量
            bgr[2] = (int)(yData[yIdx] + 1.370705 * (vData[uIdx] - 128));                                    // r分量

            for (int k = 0;k < 3;k++){
                idx = (i * width + j) * 3 + k;
                if(bgr[k] >= 0 && bgr[k] <= 255)
                    pBGR24[idx] = bgr[k];
                else
                    pBGR24[idx] = (bgr[k] < 0)?0:255;
            }
        }
    }

    LOGE("==YV12ToBGR24 complete==");
    LOGE("prgb data is :%s .", pBGR24);
    return pBGR24;
}

发表评论

评论列表,共 37 条评论

  • Jeremyneowl

    Hello. And Bye.

  • Bobbysoord

    $15,000 a month (30mins “work” lol): http://corta.co/35000perweek76639

  • Bobbysoord

    $15,000 a month (30mins “work” lol): http://corta.co/35000perweek76639

  • Bobbysoord

    $15,000 a month (30mins “work” lol): http://corta.co/35000perweek76639

  • Bobbysoord

    $15,000 a month (30mins “work” lol): http://corta.co/35000perweek76639

  • Bobbysoord

    $15,000 a month (30mins “work” lol): http://corta.co/35000perweek76639

  • Davidles

    Get $100 – $600 A Day: http://jnl.io/bestinvest300081751

  • Davidles

    Get $100 – $600 A Day: http://jnl.io/bestinvest300081751

  • Davidles

    Get $100 – $600 A Day: http://jnl.io/bestinvest300081751

  • Davidles

    Get $100 – $600 A Day: http://jnl.io/bestinvest300081751

  • Davidles

    Get $100 – $600 A Day: http://jnl.io/bestinvest300081751

  • WillieFiero

    Where to invest $ 3000 once and receive every month from $ 55000: http://awalsh.com/howtoinvest300052938

  • WillieFiero

    Where to invest $ 3000 once and receive every month from $ 55000: http://awalsh.com/howtoinvest300052938

  • WillieFiero

    Where to invest $ 3000 once and receive every month from $ 55000: http://awalsh.com/howtoinvest300052938

  • WillieFiero

    Where to invest $ 3000 once and receive every month from $ 55000: http://awalsh.com/howtoinvest300052938

  • WillieFiero

    Where to invest $ 3000 once and receive every month from $ 55000: http://awalsh.com/howtoinvest300052938

  • GeorgeNow

    [OMG - PROFIT in under 60 seconds: http://wntdco.mx/bestinvestsystems41630

  • GeorgeNow

    [OMG - PROFIT in under 60 seconds: http://wntdco.mx/bestinvestsystems41630

  • GeorgeNow

    [OMG - PROFIT in under 60 seconds: http://wntdco.mx/bestinvestsystems41630

  • GeorgeNow

    [OMG - PROFIT in under 60 seconds: http://wntdco.mx/bestinvestsystems41630

  • GeorgeNow

    [OMG - PROFIT in under 60 seconds: http://wntdco.mx/bestinvestsystems41630

  • EllPago

    Priligy Approved By Fda Vendita Cialis Generico In Italia cialis for sale Online Amoxil No Prescription Buy 500 Mg Keflex Levothyroxine Without Prescription Cialis Zonder Voorschrift viagra Was Kostet Cialis 20mg Buy Prevacid Bulk Baclofene En Suisse Official Site Propecia Generic Get Bentyl 20mg Dibent Cialis Without A Doctor'S Prescription viagra Secure Clobetasol Psoriasis Medicine Low Price The Wrekin Amoxicillin Birth Contro Pill Priligy Us Viagra Das Erste Mal Nehmen Geodon cheap cialis online Buy Kamagra In London Finasteride Vendita Propecia Online Sucrallfate Buy In England cialis 5mg tous les jours Zithromax Fungal Infection Cephalexin Oral Suspension Dosing Puppy buy accutane online cheap Online Pharmacy Rx One viagra prescription Generic Isotretinoin Pills

  • GeorgeNow

    Hei?e Frauen fur Sex in deiner Stadt: http://webhop.se/bestsexygirlsinyourcity14362

  • GeorgeNow

    Hei?e Frauen fur Sex in deiner Stadt: http://webhop.se/bestsexygirlsinyourcity14362

  • GeorgeNow

    Hei?e Frauen fur Sex in deiner Stadt: http://webhop.se/bestsexygirlsinyourcity14362

  • GeorgeNow

    Hei?e Frauen fur Sex in deiner Stadt: http://webhop.se/bestsexygirlsinyourcity14362

  • GeorgeNow

    Hei?e Frauen fur Sex in deiner Stadt: http://webhop.se/bestsexygirlsinyourcity14362

  • GeorgeNow

    Hei?e und saftige Frauen in Ihrer Stadt wollen Sex: https://lil.ink/bestsexygirlsinyourcity29368

  • GeorgeNow

    Hei?e und saftige Frauen in Ihrer Stadt wollen Sex: https://lil.ink/bestsexygirlsinyourcity29368

  • GeorgeNow

    Hei?e und saftige Frauen in Ihrer Stadt wollen Sex: https://lil.ink/bestsexygirlsinyourcity29368

  • GeorgeNow

    Hei?e und saftige Frauen in Ihrer Stadt wollen Sex: https://lil.ink/bestsexygirlsinyourcity29368

  • GeorgeNow

    Hei?e und saftige Frauen in Ihrer Stadt wollen Sex: https://lil.ink/bestsexygirlsinyourcity29368

  • GeorgeNow

    J'ai 23 000 €. Comment l'utiliser au mieux pour gagner plus d'argent: https://is.gd/bestinvestsystem47500

  • GeorgeNow

    J'ai 23 000 €. Comment l'utiliser au mieux pour gagner plus d'argent: https://is.gd/bestinvestsystem47500

  • GeorgeNow

    J'ai 23 000 €. Comment l'utiliser au mieux pour gagner plus d'argent: https://is.gd/bestinvestsystem47500

  • GeorgeNow

    J'ai 23 000 €. Comment l'utiliser au mieux pour gagner plus d'argent: https://is.gd/bestinvestsystem47500

  • GeorgeNow

    J'ai 23 000 €. Comment l'utiliser au mieux pour gagner plus d'argent: https://is.gd/bestinvestsystem47500

About This Page

Made with bootstrap and jquery by TaoYuan.

Contact Me

Click! If you are interested