diff options
Diffstat (limited to 'contrib/ffmpeg/libswscale/yuv2rgb.c')
-rw-r--r-- | contrib/ffmpeg/libswscale/yuv2rgb.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/contrib/ffmpeg/libswscale/yuv2rgb.c b/contrib/ffmpeg/libswscale/yuv2rgb.c index 9066b68b2..af7f86f40 100644 --- a/contrib/ffmpeg/libswscale/yuv2rgb.c +++ b/contrib/ffmpeg/libswscale/yuv2rgb.c @@ -22,8 +22,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * along with mpeg2dec; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * MMX/MMX2 Template stuff from Michael Niedermayer (michaelni@gmx.at) (needed for fast movntq support) * 1,4,8bpp support by Michael Niedermayer (michaelni@gmx.at) @@ -213,9 +213,9 @@ const int32_t Inverse_Table_6_9[8][4] = { #define RGB(i) \ U = pu[i]; \ V = pv[i]; \ - r = c->table_rV[V]; \ - g = c->table_gU[U] + c->table_gV[V]; \ - b = c->table_bU[U]; + r = (void *)c->table_rV[V]; \ + g = (void *)(c->table_gU[U] + c->table_gV[V]); \ + b = (void *)c->table_bU[U]; #define DST1(i) \ Y = py_1[2*i]; \ @@ -265,14 +265,16 @@ static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSlic for(y=0; y<srcSliceH; y+=2){\ dst_type *dst_1= (dst_type*)(dst[0] + (y+srcSliceY )*dstStride[0]);\ dst_type *dst_2= (dst_type*)(dst[0] + (y+srcSliceY+1)*dstStride[0]);\ - dst_type *r, *g, *b;\ + dst_type attribute_unused *r, *b;\ + dst_type *g;\ uint8_t *py_1= src[0] + y*srcStride[0];\ uint8_t *py_2= py_1 + srcStride[0];\ uint8_t *pu= src[1] + (y>>1)*srcStride[1];\ uint8_t *pv= src[2] + (y>>1)*srcStride[2];\ unsigned int h_size= c->dstW>>3;\ while (h_size--) {\ - int U, V, Y;\ + int attribute_unused U, V;\ + int Y;\ #define EPILOG(dst_delta)\ pu += 4;\ @@ -609,7 +611,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c) } #endif - MSG_WARN("No accelerated colorspace conversion found\n"); + av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found\n"); switch(c->dstFormat){ case PIX_FMT_BGR32: @@ -668,6 +670,11 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, if(!fullRange){ cy= (cy*255) / 219; oy= 16<<16; + }else{ + crv= (crv*224) / 255; + cbu= (cbu*224) / 255; + cgu= (cgu*224) / 255; + cgv= (cgv*224) / 255; } cy = (cy *contrast )>>16; @@ -826,16 +833,16 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, default: table_start= NULL; - MSG_ERR("%ibpp not supported by yuv2rgb\n", bpp); + av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp); //free mem? return -1; } for (i = 0; i < 256; i++) { - c->table_rV[i] = table_r + entry_size * div_round (crv * (i-128), 76309); - c->table_gU[i] = table_g + entry_size * div_round (cgu * (i-128), 76309); + c->table_rV[i] = (uint8_t *)table_r + entry_size * div_round (crv * (i-128), 76309); + c->table_gU[i] = (uint8_t *)table_g + entry_size * div_round (cgu * (i-128), 76309); c->table_gV[i] = entry_size * div_round (cgv * (i-128), 76309); - c->table_bU[i] = table_b + entry_size * div_round (cbu * (i-128), 76309); + c->table_bU[i] = (uint8_t *)table_b + entry_size * div_round (cbu * (i-128), 76309); } av_free(c->yuvTable); |