⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcolor_kc.i

📁 H.264完整的C语言代码和DCT的代码
💻 I
📖 第 1 页 / 共 2 页
字号:
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Ya[4] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Ya[5] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);


    

    datain >> color1 >> color2 >> color3 >> color4;

    a1 = half2(shuffle(color1, shuf_func1));
    b1 = half2(shuffle(color1, shuf_func2));
    a2 = half2(shuffle(color2, shuf_func1));
    b2 = half2(shuffle(color2, shuf_func2));
    a3 = half2(shuffle(color3, shuf_func1));
    b3 = half2(shuffle(color3, shuf_func2));
    a4 = half2(shuffle(color4, shuf_func1));
    b4 = half2(shuffle(color4, shuf_func2));

    c1 = hi(mulrnd(RB_SCALE, shift(a1, 1)));
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Ya[6] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Ya[7] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);


    

    datain >> color1 >> color2 >> color3 >> color4;

    a1 = half2(shuffle(color1, shuf_func1));
    b1 = half2(shuffle(color1, shuf_func2));
    a2 = half2(shuffle(color2, shuf_func1));
    b2 = half2(shuffle(color2, shuf_func2));
    a3 = half2(shuffle(color3, shuf_func1));
    b3 = half2(shuffle(color3, shuf_func2));
    a4 = half2(shuffle(color4, shuf_func1));
    b4 = half2(shuffle(color4, shuf_func2));

    c1 = hi(mulrnd(RB_SCALE, shift(a1, 1)));
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Yb[0] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Yb[1] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);


    

    datain >> color1 >> color2 >> color3 >> color4;

    a1 = half2(shuffle(color1, shuf_func1));
    b1 = half2(shuffle(color1, shuf_func2));
    a2 = half2(shuffle(color2, shuf_func1));
    b2 = half2(shuffle(color2, shuf_func2));
    a3 = half2(shuffle(color3, shuf_func1));
    b3 = half2(shuffle(color3, shuf_func2));
    a4 = half2(shuffle(color4, shuf_func1));
    b4 = half2(shuffle(color4, shuf_func2));

    c1 = hi(mulrnd(RB_SCALE, shift(a1, 1)));
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Yb[2] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Yb[3] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);


    

    datain >> color1 >> color2 >> color3 >> color4;

    a1 = half2(shuffle(color1, shuf_func1));
    b1 = half2(shuffle(color1, shuf_func2));
    a2 = half2(shuffle(color2, shuf_func1));
    b2 = half2(shuffle(color2, shuf_func2));
    a3 = half2(shuffle(color3, shuf_func1));
    b3 = half2(shuffle(color3, shuf_func2));
    a4 = half2(shuffle(color4, shuf_func1));
    b4 = half2(shuffle(color4, shuf_func2));

    c1 = hi(mulrnd(RB_SCALE, shift(a1, 1)));
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Yb[4] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Yb[5] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);


    

    datain >> color1 >> color2 >> color3 >> color4;

    a1 = half2(shuffle(color1, shuf_func1));
    b1 = half2(shuffle(color1, shuf_func2));
    a2 = half2(shuffle(color2, shuf_func1));
    b2 = half2(shuffle(color2, shuf_func2));
    a3 = half2(shuffle(color3, shuf_func1));
    b3 = half2(shuffle(color3, shuf_func2));
    a4 = half2(shuffle(color4, shuf_func1));
    b4 = half2(shuffle(color4, shuf_func2));

    c1 = hi(mulrnd(RB_SCALE, shift(a1, 1)));
    c2 = hi(mulrnd(RB_SCALE, shift(a2, 1)));
    c3 = hi(mulrnd(RB_SCALE, shift(a3, 1)));
    c4 = hi(mulrnd(RB_SCALE, shift(a4, 1)));

    d1 = c1 + hi(mulrnd(G_SCALE, shift(b1, 1)));
    d2 = c2 + hi(mulrnd(G_SCALE, shift(b2, 1)));
    d3 = c3 + hi(mulrnd(G_SCALE, shift(b3, 1)));
    d4 = c4 + hi(mulrnd(G_SCALE, shift(b4, 1)));

    z1 = half2(shuffle(d1 + half2(shift(int(c1), -16)), shuf_func3));
    z2 = half2(shuffle(d2 + half2(shift(int(c2), -16)), shuf_func3));
    z3 = half2(shuffle(d3 + half2(shift(int(c3), -16)), shuf_func3));
    z4 = half2(shuffle(d4 + half2(shift(int(c4), -16)), shuf_func3));

    temp0 = select(Y_combine, z2, z1);
    temp1 = select(Y_combine, z4, z3);
    Yb[6] = hi(mulrnd(Ymadj, shift(temp0, 1)))+Yaadj;
    Yb[7] = hi(mulrnd(Ymadj, shift(temp1, 1)))+Yaadj;

    first = hi(((a1 + a3) - (z1 + z3)) * C_SCALE) + one_two_eight;
    second = hi(((a2 + a4) - (z2 + z4)) * C_SCALE) + one_two_eight;
    first = commucperm(perm_a, first);
    second = commucperm(perm_b, second);
    CrCbout << select(low, first, second);

    
    dest_idx = cid();
    send_idx = cid();
    Yc[dest_idx] = Ya[send_idx];
    Yd[dest_idx] = Yb[send_idx];
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    uc<int> u = 0;
    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Yc[dest_idx] = half2(commclperm(dest_idx, int(Ya[send_idx]), u));
    Yd[dest_idx] = half2(commclperm(dest_idx, int(Yb[send_idx]), u));
    dest_idx = (dest_idx - 1) & 7;
    send_idx = (send_idx + 1) & 7;

    Ye[0] = ubyte4(shuffle(Yc[0], 0x08020800));
    Ye[1] = ubyte4(shuffle(Yc[1], 0x08020800));
    Ye[2] = ubyte4(shuffle(Yc[2], 0x08020800));
    Ye[3] = ubyte4(shuffle(Yc[3], 0x08020800));
    Ye[4] = ubyte4(shuffle(Yc[4], 0x08020800));
    Ye[5] = ubyte4(shuffle(Yc[5], 0x08020800));
    Ye[6] = ubyte4(shuffle(Yc[6], 0x08020800));
    Ye[7] = ubyte4(shuffle(Yc[7], 0x08020800));
    Yf[0] = ubyte4(shuffle(Yd[0], 0x08020800));
    Yf[1] = ubyte4(shuffle(Yd[1], 0x08020800));
    Yf[2] = ubyte4(shuffle(Yd[2], 0x08020800));
    Yf[3] = ubyte4(shuffle(Yd[3], 0x08020800));
    Yf[4] = ubyte4(shuffle(Yd[4], 0x08020800));
    Yf[5] = ubyte4(shuffle(Yd[5], 0x08020800));
    Yf[6] = ubyte4(shuffle(Yd[6], 0x08020800));
    Yf[7] = ubyte4(shuffle(Yd[7], 0x08020800));
    
    outa = shuffled(Ye[0], 0x02888888);
    outb = shuffled(Ye[1], 0x88028888);
    outc = shuffled(Ye[2], 0x88880288);
    outd = shuffled(Ye[3], 0x88888802);
    out[0] = ubyte4((hi(outa) | hi(outb)) | (hi(outc) | hi(outd)));
    out[4] = ubyte4((lo(outa) | lo(outb)) | (lo(outc) | lo(outd)));

    outa = shuffled(Yf[0], 0x02888888);
    outb = shuffled(Yf[1], 0x88028888);
    outc = shuffled(Yf[2], 0x88880288);
    outd = shuffled(Yf[3], 0x88888802);
    out[1] = ubyte4((hi(outa) | hi(outb)) | (hi(outc) | hi(outd)));
    out[5] = ubyte4((lo(outa) | lo(outb)) | (lo(outc) | lo(outd)));

    outa = shuffled(Ye[4], 0x02888888);
    outb = shuffled(Ye[5], 0x88028888);
    outc = shuffled(Ye[6], 0x88880288);
    outd = shuffled(Ye[7], 0x88888802);
    out[2] = ubyte4((hi(outa) | hi(outb)) | (hi(outc) | hi(outd)));
    out[6] = ubyte4((lo(outa) | lo(outb)) | (lo(outc) | lo(outd)));

    outa = shuffled(Yf[4], 0x02888888);
    outb = shuffled(Yf[5], 0x88028888);
    outc = shuffled(Yf[6], 0x88880288);
    outd = shuffled(Yf[7], 0x88888802);
    out[3] = ubyte4((hi(outa) | hi(outb)) | (hi(outc) | hi(outd)));
    out[7] = ubyte4((lo(outa) | lo(outb)) | (lo(outc) | lo(outd)));

    Yout << out[0];
    Yout << out[1];
    Yout << out[2];
    Yout << out[3];
    Yout << out[4];
    Yout << out[5];
    Yout << out[6];
    Yout << out[7];
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -