1
|
1 8,10d7
|
|
2 < // Hmm. Enabling this makes about 20% speedup too! (Celeron2+G400+UtahGLX)
|
|
3 < //#define TEXSUBIMAGE_BUG_WORKAROUND
|
|
4 <
|
|
5 369,370c366,367
|
|
6 < static inline uint32_t
|
|
7 < draw_slice_x11(uint8_t *src[], uint32_t slice_num)
|
|
8 ---
|
|
9 > //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num)
|
|
10 > static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
|
|
11 372,375c369,372
|
|
12 < uint8_t *dst;
|
|
13 < int i;
|
|
14 <
|
|
15 < dst = ImageData;// + image_width * 16 * BYTES_PP * slice_num;
|
|
16 ---
|
|
17 > int i;
|
|
18 > int dstride=w*BYTES_PP;
|
|
19 >
|
|
20 > dstride=(dstride+15)&(~15);
|
|
21 377,379c374,375
|
|
22 < yuv2rgb(dst , src[0], src[1], src[2],
|
|
23 < image_width, 16,
|
|
24 < image_width*BYTES_PP, image_width, image_width/2 );
|
|
25 ---
|
|
26 > yuv2rgb(ImageData, src[0], src[1], src[2],
|
|
27 > w,h, dstride, stride[0],stride[1]);
|
|
28 383,384c379
|
|
29 < #ifdef TEXSUBIMAGE_BUG_WORKAROUND
|
|
30 < for(i=0;i<16;i++){
|
|
31 ---
|
|
32 > for(i=0;i<h;i++){
|
|
33 387,389c382,384
|
|
34 < 0, // x offset
|
|
35 < 16*slice_num+i, // y offset
|
|
36 < image_width, // width
|
|
37 ---
|
|
38 > x, // x offset
|
|
39 > y+i, // y offset
|
|
40 > w, // width
|
|
41 393c388
|
|
42 < ImageData+i*BYTES_PP*image_width ); // *pixels
|
|
43 ---
|
|
44 > ImageData+i*dstride ); // *pixels
|
|
45 395,406d389
|
|
46 < #else
|
|
47 < //printf("uploading slice \n");
|
|
48 < glTexSubImage2D( GL_TEXTURE_2D, // target
|
|
49 < 0, // level
|
|
50 < 0, // x offset
|
|
51 < 16*slice_num, // y offset
|
|
52 < image_width, // width
|
|
53 < 16, // height
|
|
54 < (BYTES_PP==4)?GL_RGBA:GL_RGB, // format
|
|
55 < GL_UNSIGNED_BYTE, // type
|
|
56 < ImageData ); // *pixels
|
|
57 < #endif
|
|
58 409,414d391
|
|
59 < }
|
|
60 <
|
|
61 < static uint32_t
|
|
62 < draw_slice(uint8_t *src[], uint32_t slice_num)
|
|
63 < {
|
|
64 < return draw_slice_x11(src,slice_num);
|