mirror of https://github.com/mpv-player/mpv
65 lines
1.8 KiB
Diff
65 lines
1.8 KiB
Diff
8,10d7
|
|
< // Hmm. Enabling this makes about 20% speedup too! (Celeron2+G400+UtahGLX)
|
|
< //#define TEXSUBIMAGE_BUG_WORKAROUND
|
|
<
|
|
369,370c366,367
|
|
< static inline uint32_t
|
|
< draw_slice_x11(uint8_t *src[], uint32_t slice_num)
|
|
---
|
|
> //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num)
|
|
> static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
|
|
372,375c369,372
|
|
< uint8_t *dst;
|
|
< int i;
|
|
<
|
|
< dst = ImageData;// + image_width * 16 * BYTES_PP * slice_num;
|
|
---
|
|
> int i;
|
|
> int dstride=w*BYTES_PP;
|
|
>
|
|
> dstride=(dstride+15)&(~15);
|
|
377,379c374,375
|
|
< yuv2rgb(dst , src[0], src[1], src[2],
|
|
< image_width, 16,
|
|
< image_width*BYTES_PP, image_width, image_width/2 );
|
|
---
|
|
> yuv2rgb(ImageData, src[0], src[1], src[2],
|
|
> w,h, dstride, stride[0],stride[1]);
|
|
383,384c379
|
|
< #ifdef TEXSUBIMAGE_BUG_WORKAROUND
|
|
< for(i=0;i<16;i++){
|
|
---
|
|
> for(i=0;i<h;i++){
|
|
387,389c382,384
|
|
< 0, // x offset
|
|
< 16*slice_num+i, // y offset
|
|
< image_width, // width
|
|
---
|
|
> x, // x offset
|
|
> y+i, // y offset
|
|
> w, // width
|
|
393c388
|
|
< ImageData+i*BYTES_PP*image_width ); // *pixels
|
|
---
|
|
> ImageData+i*dstride ); // *pixels
|
|
395,406d389
|
|
< #else
|
|
< //printf("uploading slice \n");
|
|
< glTexSubImage2D( GL_TEXTURE_2D, // target
|
|
< 0, // level
|
|
< 0, // x offset
|
|
< 16*slice_num, // y offset
|
|
< image_width, // width
|
|
< 16, // height
|
|
< (BYTES_PP==4)?GL_RGBA:GL_RGB, // format
|
|
< GL_UNSIGNED_BYTE, // type
|
|
< ImageData ); // *pixels
|
|
< #endif
|
|
409,414d391
|
|
< }
|
|
<
|
|
< static uint32_t
|
|
< draw_slice(uint8_t *src[], uint32_t slice_num)
|
|
< {
|
|
< return draw_slice_x11(src,slice_num);
|