Revision 4cfbf61b libavcodec/imgconvert.c

View differences:

libavcodec/imgconvert.c
747 747
 cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS]
748 748

  
749 749
/* NOTE: the clamp is really necessary! */
750
#define C_JPEG_TO_CCIR(y)\
751
({\
752
    int __y;\
753
    __y = ((((y) - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);\
754
    if (__y < 16)\
755
         __y = 16;\
756
    __y;\
757
})
750
static inline int C_JPEG_TO_CCIR(int y) {
751
    y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS);
752
    if (y < 16)
753
	y = 16;
754
    return y;
755
}
756

  
758 757

  
759 758
#define RGB_TO_Y(r, g, b) \
760 759
((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
......
1608 1607
    void *ptr;
1609 1608

  
1610 1609
    size = avpicture_get_size(pix_fmt, width, height);
1611
    if (size < 0)
1612
        goto fail;
1613 1610
    ptr = av_malloc(size);
1614 1611
    if (!ptr)
1615 1612
        goto fail;

Also available in: Unified diff