mirror of https://github.com/mpv-player/mpv
osd: remove FAST_OSD code
This code has never been active by default, ever since it was added back in 2001. You had to edit config.h or configure manually to enable it.
This commit is contained in:
parent
7484ae8e2e
commit
477af1c777
|
@ -3997,12 +3997,6 @@ cat > $TMPH << EOF
|
|||
/* set up audio OUTBURST. Do not change this! */
|
||||
#define OUTBURST 512
|
||||
|
||||
/* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
|
||||
#undef FAST_OSD
|
||||
#undef FAST_OSD_TABLE
|
||||
|
||||
|
||||
|
||||
#define CONFIGURATION "$configuration"
|
||||
|
||||
#define MPLAYER_DATADIR "$_datadir"
|
||||
|
|
43
libvo/osd.c
43
libvo/osd.c
|
@ -20,9 +20,6 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
//#define FAST_OSD
|
||||
//#define FAST_OSD_TABLE
|
||||
|
||||
#include "config.h"
|
||||
#include "osd.h"
|
||||
#include "mp_msg.h"
|
||||
|
@ -156,21 +153,7 @@ void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, i
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef FAST_OSD_TABLE
|
||||
static unsigned short fast_osd_12bpp_table[256];
|
||||
static unsigned short fast_osd_15bpp_table[256];
|
||||
static unsigned short fast_osd_16bpp_table[256];
|
||||
#endif
|
||||
|
||||
void vo_draw_alpha_init(void){
|
||||
#ifdef FAST_OSD_TABLE
|
||||
int i;
|
||||
for(i=0;i<256;i++){
|
||||
fast_osd_12bpp_table[i]=((i>>4)<< 8)|((i>>4)<<4)|(i>>4);
|
||||
fast_osd_15bpp_table[i]=((i>>3)<<10)|((i>>3)<<5)|(i>>3);
|
||||
fast_osd_16bpp_table[i]=((i>>3)<<11)|((i>>2)<<5)|(i>>3);
|
||||
}
|
||||
#endif
|
||||
//FIXME the optimized stuff is a lie for 15/16bpp as they aren't optimized yet
|
||||
if( mp_msg_test(MSGT_OSD,MSGL_V) )
|
||||
{
|
||||
|
@ -196,14 +179,6 @@ void vo_draw_alpha_rgb12(int w, int h, unsigned char* src, unsigned char *srca,
|
|||
register int x;
|
||||
for (x = 0; x < w; x++) {
|
||||
if(srca[x]){
|
||||
#ifdef FAST_OSD
|
||||
#ifdef FAST_OSD_TABLE
|
||||
dst[x] = fast_osd_12bpp_table[src[x]];
|
||||
#else
|
||||
register unsigned int a = src[x] >> 4;
|
||||
dst[x] = (a << 8) | (a << 4) | a;
|
||||
#endif
|
||||
#else
|
||||
unsigned char r = dst[x] & 0x0F;
|
||||
unsigned char g = (dst[x] >> 4) & 0x0F;
|
||||
unsigned char b = (dst[x] >> 8) & 0x0F;
|
||||
|
@ -211,7 +186,6 @@ void vo_draw_alpha_rgb12(int w, int h, unsigned char* src, unsigned char *srca,
|
|||
g = (((g*srca[x]) >> 4) + src[x]) >> 4;
|
||||
b = (((b*srca[x]) >> 4) + src[x]) >> 4;
|
||||
dst[x] = (b << 8) | (g << 4) | r;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
src += srcstride;
|
||||
|
@ -228,14 +202,6 @@ void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, i
|
|||
register int x;
|
||||
for(x=0;x<w;x++){
|
||||
if(srca[x]){
|
||||
#ifdef FAST_OSD
|
||||
#ifdef FAST_OSD_TABLE
|
||||
dst[x]=fast_osd_15bpp_table[src[x]];
|
||||
#else
|
||||
register unsigned int a=src[x]>>3;
|
||||
dst[x]=(a<<10)|(a<<5)|a;
|
||||
#endif
|
||||
#else
|
||||
unsigned char r=dst[x]&0x1F;
|
||||
unsigned char g=(dst[x]>>5)&0x1F;
|
||||
unsigned char b=(dst[x]>>10)&0x1F;
|
||||
|
@ -243,7 +209,6 @@ void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, i
|
|||
g=(((g*srca[x])>>5)+src[x])>>3;
|
||||
b=(((b*srca[x])>>5)+src[x])>>3;
|
||||
dst[x]=(b<<10)|(g<<5)|r;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
src+=srcstride;
|
||||
|
@ -260,13 +225,6 @@ void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, i
|
|||
register int x;
|
||||
for(x=0;x<w;x++){
|
||||
if(srca[x]){
|
||||
#ifdef FAST_OSD
|
||||
#ifdef FAST_OSD_TABLE
|
||||
dst[x]=fast_osd_16bpp_table[src[x]];
|
||||
#else
|
||||
dst[x]=((src[x]>>3)<<11)|((src[x]>>2)<<5)|(src[x]>>3);
|
||||
#endif
|
||||
#else
|
||||
unsigned char r=dst[x]&0x1F;
|
||||
unsigned char g=(dst[x]>>5)&0x3F;
|
||||
unsigned char b=(dst[x]>>11)&0x1F;
|
||||
|
@ -274,7 +232,6 @@ void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, i
|
|||
g=(((g*srca[x])>>6)+src[x])>>2;
|
||||
b=(((b*srca[x])>>5)+src[x])>>3;
|
||||
dst[x]=(b<<11)|(g<<5)|r;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
src+=srcstride;
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
|
||||
static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
|
||||
int y;
|
||||
#if defined(FAST_OSD) && !HAVE_MMX
|
||||
w=w>>1;
|
||||
#endif
|
||||
#if HAVE_MMX
|
||||
__asm__ volatile(
|
||||
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
|
||||
|
@ -87,12 +84,7 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
|
|||
}
|
||||
#else
|
||||
for(x=0;x<w;x++){
|
||||
#ifdef FAST_OSD
|
||||
if(srca[2*x+0]) dstbase[2*x+0]=src[2*x+0];
|
||||
if(srca[2*x+1]) dstbase[2*x+1]=src[2*x+1];
|
||||
#else
|
||||
if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x];
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
src+=srcstride;
|
||||
|
@ -107,9 +99,6 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
|
|||
|
||||
static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
|
||||
int y;
|
||||
#if defined(FAST_OSD) && !HAVE_MMX
|
||||
w=w>>1;
|
||||
#endif
|
||||
#if HAVE_MMX
|
||||
__asm__ volatile(
|
||||
"pxor %%mm7, %%mm7\n\t"
|
||||
|
@ -156,15 +145,10 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
|
|||
}
|
||||
#else
|
||||
for(x=0;x<w;x++){
|
||||
#ifdef FAST_OSD
|
||||
if(srca[2*x+0]) dstbase[4*x+0]=src[2*x+0];
|
||||
if(srca[2*x+1]) dstbase[4*x+2]=src[2*x+1];
|
||||
#else
|
||||
if(srca[x]) {
|
||||
dstbase[2*x]=((dstbase[2*x]*srca[x])>>8)+src[x];
|
||||
dstbase[2*x+1]=((((signed)dstbase[2*x+1]-128)*srca[x])>>8)+128;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
src+=srcstride;
|
||||
|
@ -264,13 +248,9 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
|
|||
#else /*non x86 arch or x86_64 with MMX disabled */
|
||||
for(x=0;x<w;x++){
|
||||
if(srca[x]){
|
||||
#ifdef FAST_OSD
|
||||
dst[0]=dst[1]=dst[2]=src[x];
|
||||
#else
|
||||
dst[0]=((dst[0]*srca[x])>>8)+src[x];
|
||||
dst[1]=((dst[1]*srca[x])>>8)+src[x];
|
||||
dst[2]=((dst[2]*srca[x])>>8)+src[x];
|
||||
#endif
|
||||
}
|
||||
dst+=3; // 24bpp
|
||||
}
|
||||
|
@ -386,13 +366,9 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
|
|||
#else /*non x86 arch or x86_64 with MMX disabled */
|
||||
for(x=0;x<w;x++){
|
||||
if(srca[x]){
|
||||
#ifdef FAST_OSD
|
||||
dstbase[4*x+0]=dstbase[4*x+1]=dstbase[4*x+2]=src[x];
|
||||
#else
|
||||
dstbase[4*x+0]=((dstbase[4*x+0]*srca[x])>>8)+src[x];
|
||||
dstbase[4*x+1]=((dstbase[4*x+1]*srca[x])>>8)+src[x];
|
||||
dstbase[4*x+2]=((dstbase[4*x+2]*srca[x])>>8)+src[x];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* arch_x86 */
|
||||
|
|
|
@ -66,19 +66,15 @@ struct gl_priv {
|
|||
int scaled_osd;
|
||||
//! Textures for OSD
|
||||
GLuint osdtex[MAX_OSD_PARTS];
|
||||
#ifndef FAST_OSD
|
||||
//! Alpha textures for OSD
|
||||
GLuint osdatex[MAX_OSD_PARTS];
|
||||
#endif
|
||||
GLuint eosd_texture;
|
||||
int eosd_texture_width, eosd_texture_height;
|
||||
struct eosd_packer *eosd;
|
||||
struct vertex_eosd *eosd_va;
|
||||
//! Display lists that draw the OSD parts
|
||||
GLuint osdDispList[MAX_OSD_PARTS];
|
||||
#ifndef FAST_OSD
|
||||
GLuint osdaDispList[MAX_OSD_PARTS];
|
||||
#endif
|
||||
//! How many parts the OSD currently consists of
|
||||
int osdtexCnt;
|
||||
int osd_color;
|
||||
|
@ -267,11 +263,9 @@ static void clearOSD(struct vo *vo)
|
|||
if (!p->osdtexCnt)
|
||||
return;
|
||||
gl->DeleteTextures(p->osdtexCnt, p->osdtex);
|
||||
#ifndef FAST_OSD
|
||||
gl->DeleteTextures(p->osdtexCnt, p->osdatex);
|
||||
for (i = 0; i < p->osdtexCnt; i++)
|
||||
gl->DeleteLists(p->osdaDispList[i], 1);
|
||||
#endif
|
||||
for (i = 0; i < p->osdtexCnt; i++)
|
||||
gl->DeleteLists(p->osdDispList[i], 1);
|
||||
p->osdtexCnt = 0;
|
||||
|
@ -695,7 +689,6 @@ static void create_osd_texture(void *ctx, int x0, int y0, int w, int h,
|
|||
glUploadTex(gl, p->target, GL_LUMINANCE, GL_UNSIGNED_BYTE, src, stride,
|
||||
0, 0, w, h, 0);
|
||||
|
||||
#ifndef FAST_OSD
|
||||
gl->GenTextures(1, &p->osdatex[p->osdtexCnt]);
|
||||
gl->BindTexture(p->target, p->osdatex[p->osdtexCnt]);
|
||||
glCreateClearTex(gl, p->target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE,
|
||||
|
@ -711,19 +704,17 @@ static void create_osd_texture(void *ctx, int x0, int y0, int w, int h,
|
|||
0, 0, w, h, 0);
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
gl->BindTexture(p->target, 0);
|
||||
|
||||
// Create a list for rendering this OSD part
|
||||
#ifndef FAST_OSD
|
||||
p->osdaDispList[p->osdtexCnt] = gl->GenLists(1);
|
||||
gl->NewList(p->osdaDispList[p->osdtexCnt], GL_COMPILE);
|
||||
// render alpha
|
||||
gl->BindTexture(p->target, p->osdatex[p->osdtexCnt]);
|
||||
glDrawTex(gl, x0, y0, w, h, 0, 0, w, h, sx, sy, p->use_rectangle == 1, 0, 0);
|
||||
gl->EndList();
|
||||
#endif
|
||||
|
||||
p->osdDispList[p->osdtexCnt] = gl->GenLists(1);
|
||||
gl->NewList(p->osdDispList[p->osdtexCnt], GL_COMPILE);
|
||||
// render OSD
|
||||
|
@ -765,10 +756,8 @@ static void do_render_osd(struct vo *vo, int type)
|
|||
gl->Color4ub((p->osd_color >> 16) & 0xff, (p->osd_color >> 8) & 0xff,
|
||||
p->osd_color & 0xff, 0xff - (p->osd_color >> 24));
|
||||
// draw OSD
|
||||
#ifndef FAST_OSD
|
||||
gl->BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
|
||||
gl->CallLists(p->osdtexCnt, GL_UNSIGNED_INT, p->osdaDispList);
|
||||
#endif
|
||||
gl->BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
gl->CallLists(p->osdtexCnt, GL_UNSIGNED_INT, p->osdDispList);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue