📄 idxgen_kc.i
字号:
#line 1 "D:\\working\\im_apps\\h264\\idxgen_kc.cpp"
#line 1 "D:/working/tools/isim/isimexe/blank_headers\\idb_kernelc.hpp"
#line 2 "D:\\working\\im_apps\\h264\\idxgen_kc.cpp"
#line 1 "D:\\working\\im_apps\\h264\\mpeg.hpp"
#line 1 "D:/working/tools/isim/isimexe/blank_headers\\idb_types.hpp"
#line 6 "D:\\working\\im_apps\\h264\\mpeg.hpp"
#line 1 "D:/working/tools/isim/isimexe/blank_headers\\idb_deftypes.hpp"
#line 7 "D:\\working\\im_apps\\h264\\mpeg.hpp"
#decl idxGen(ostream<uint> indices,
uc<int>& uc_size,
uc<int>& uc_params);
;
#decl icolor(istream<ubyte4> datain,
ostream<half2> Yout,
ostream<half2> CrCbout);
;
#decl pcolor(istream<ubyte4> datain,
ostream<ubyte4> Yout,
ostream<half2> CrCbout);
;
#decl dct(istream<half2> datain,
istream<uhalf2> consts,
ostream<half2> out,
uc<uhalf2>& uc_quantizer_scale);
;
#decl idct(istream<half2> datain,
istream<uhalf2> consts,
ostream<half2> out,
uc<half2>& uc_quantizer_scale);
;
#decl rle(istream<half2> Yin,
istream<half2> CrCbin,
istream<int> indices,
cistream<half2> motion,
costream<half2> out,
uc<uint>& pframe,
uc<uint>& quant_scale);
;
#decl difference(istream<ubyte4> curryblks,
istream<half2> currcblks,
istream<ubyte4> refyblks,
istream<half2> refcblks,
ostream<half2> diffyblks,
ostream<half2> diffcblks);
;
#decl correlate(istream<half2> diffyblks,
istream<half2> diffcblks,
istream<ubyte4> refyblks,
istream<half2> refcblks,
ostream<ubyte4> newrefyblks,
ostream<half2> newrefcblks,
uc<uint>& uc_pframe);
;
#decl MV2idx(cistream<half2> motion,
ostream<uint> yindices,
ostream<uint> crcbindices,
uc<int>& uc_offsets,
uc<int>& uc_mblks,
uc<int>& uc_mb_width);
;
#decl blocksearch(istream<ubyte4> row0,
istream<ubyte4> row1,
istream<ubyte4> row2,
istream<ubyte4> mblocks,
costream<half2> motions,
uc<int>& location);
;
#decl mb_encode(istream<byte4> datain,
istream<half2> consts,
ostream<half2> color_out,
ostream<half2> dct_out,
costream<int> out);
;
#line 1 "D:/working/tools/isim/isimexe/blank_headers\\idb_undeftypes.hpp"
#line 97 "D:\\working\\im_apps\\h264\\mpeg.hpp"
#line 99 "D:\\working\\im_apps\\h264\\mpeg.hpp"
#line 3 "D:\\working\\im_apps\\h264\\idxgen_kc.cpp"
#line 1 "D:/working/tools/isim/isimexe/blank_headers\\idb_kernelc2.hpp"
#line 4 "D:\\working\\im_apps\\h264\\idxgen_kc.cpp"
;
kernel idxGen(ostream<uint> indices,
uc<int>& uc_size,
uc<int>& uc_params)
{
byte4 unpack = 0x88883120;
int size = commclperm(ucid(), 0, uc_size);
double<int> size2 = shuffled(size, unpack);
int width = lo(size2);
int height = hi(size2);
int parms = commclperm(ucid(), 0, uc_params);
double<int> params2 = shuffled(parms, unpack);
int cnt = lo(params2);
int type = hi(params2);
uc<int> uc_cnt;
int dummy = commclperm(ucid(), cnt, uc_cnt, 0, uc_cnt);
int base_loc = 0;
int right_side = ((type == 1) | (type == 3));
int right_margin = (width & 0xf);
right_margin = select(itocc((right_margin>0) & right_side), right_margin,16);
right_margin = right_margin - 1;
int cid8 = cid() + 8;
expand<int> x(2);
x[0] = select(itocc(cid() <= right_margin), cid(), right_margin);
x[1] = select(itocc(cid8 <= right_margin), cid8, right_margin);
int bottom_row = ((type == 2) | (type == 3));
int bottom_margin = (height & 0xf);
bottom_margin = select(itocc((bottom_margin>0)&bottom_row),bottom_margin,16);
expand<int> y(15);
y[0] = select(itocc(1 < bottom_margin), width, 0);
y[1] = select(itocc(2 < bottom_margin), width, 0);
y[2] = select(itocc(3 < bottom_margin), width, 0);
y[3] = select(itocc(4 < bottom_margin), width, 0);
y[4] = select(itocc(5 < bottom_margin), width, 0);
y[5] = select(itocc(6 < bottom_margin), width, 0);
y[6] = select(itocc(7 < bottom_margin), width, 0);
y[7] = select(itocc(8 < bottom_margin), width, 0);
y[8] = select(itocc(9 < bottom_margin), width, 0);
y[9] = select(itocc(10 < bottom_margin), width, 0);
y[10] = select(itocc(11 < bottom_margin), width, 0);
y[11] = select(itocc(12 < bottom_margin), width, 0);
y[12] = select(itocc(13 < bottom_margin), width, 0);
y[13] = select(itocc(14 < bottom_margin), width, 0);
y[14] = select(itocc(15 < bottom_margin), width, 0);
loop_count(uc_cnt) {
cc last_iter = itocc(cnt == 1);
int first = select(last_iter, x[0], cid());
int second = select(last_iter, x[1], cid8);
int loc = base_loc;
indices << loc + first << loc + second; loc = loc + y[0];
indices << loc + first << loc + second; loc = loc + y[1];
indices << loc + first << loc + second; loc = loc + y[2];
indices << loc + first << loc + second; loc = loc + y[3];
indices << loc + first << loc + second; loc = loc + y[4];
indices << loc + first << loc + second; loc = loc + y[5];
indices << loc + first << loc + second; loc = loc + y[6];
indices << loc + first << loc + second; loc = loc + y[7];
indices << loc + first << loc + second; loc = loc + y[8];
indices << loc + first << loc + second; loc = loc + y[9];
indices << loc + first << loc + second; loc = loc + y[10];
indices << loc + first << loc + second; loc = loc + y[11];
indices << loc + first << loc + second; loc = loc + y[12];
indices << loc + first << loc + second; loc = loc + y[13];
indices << loc + first << loc + second; loc = loc + y[14];
indices << loc + first << loc + second;
cnt = cnt - 1;
base_loc = base_loc + 16;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -