sws: remove cliping in yuv2rgb code.

This code should not be needed and it slows things down.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/5/head
Michael Niedermayer 13 years ago
parent 689e59b7ff
commit 3be0c86b97
  1. 15
      libswscale/output.c

@ -1022,11 +1022,6 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
*g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), *g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]),
*b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; *b = c->table_bU[U + YUVRGB_TABLE_HEADROOM];
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
U = av_clip_uint8(U);
V = av_clip_uint8(V);
if (hasAlpha) { if (hasAlpha) {
A1 = (abuf0[i * 2 ] * yalpha1 + abuf1[i * 2 ] * yalpha) >> 19; A1 = (abuf0[i * 2 ] * yalpha1 + abuf1[i * 2 ] * yalpha) >> 19;
A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19; A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;
@ -1060,11 +1055,6 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
*g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), *g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]),
*b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; *b = c->table_bU[U + YUVRGB_TABLE_HEADROOM];
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
U = av_clip_uint8(U);
V = av_clip_uint8(V);
if (hasAlpha) { if (hasAlpha) {
A1 = abuf0[i * 2 ] * 255 + 16384 >> 15; A1 = abuf0[i * 2 ] * 255 + 16384 >> 15;
A2 = abuf0[i * 2 + 1] * 255 + 16384 >> 15; A2 = abuf0[i * 2 + 1] * 255 + 16384 >> 15;
@ -1087,11 +1077,6 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
*g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), *g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]),
*b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; *b = c->table_bU[U + YUVRGB_TABLE_HEADROOM];
Y1 = av_clip_uint8(Y1);
Y2 = av_clip_uint8(Y2);
U = av_clip_uint8(U);
V = av_clip_uint8(V);
if (hasAlpha) { if (hasAlpha) {
A1 = (abuf0[i * 2 ] + 64) >> 7; A1 = (abuf0[i * 2 ] + 64) >> 7;
A2 = (abuf0[i * 2 + 1] + 64) >> 7; A2 = (abuf0[i * 2 + 1] + 64) >> 7;

Loading…
Cancel
Save