Mercurial > libavcodec.hg
comparison vp3.c @ 4594:a96d905dcbaa libavcodec
Add av_ prefix to clip functions
author | reimar |
---|---|
date | Sun, 25 Feb 2007 10:27:12 +0000 |
parents | 726deec26122 |
children | b62a3a46856c |
comparison
equal
deleted
inserted
replaced
4593:2aea8bf268d8 | 4594:a96d905dcbaa |
---|---|
631 / (2*s->qr_size[inter][plane][qri]); | 631 / (2*s->qr_size[inter][plane][qri]); |
632 | 632 |
633 int qmin= 8<<(inter + !i); | 633 int qmin= 8<<(inter + !i); |
634 int qscale= i ? ac_scale_factor : dc_scale_factor; | 634 int qscale= i ? ac_scale_factor : dc_scale_factor; |
635 | 635 |
636 s->qmat[inter][plane][i]= clip((qscale * coeff)/100 * 4, qmin, 4096); | 636 s->qmat[inter][plane][i]= av_clip((qscale * coeff)/100 * 4, qmin, 4096); |
637 } | 637 } |
638 } | 638 } |
639 } | 639 } |
640 | 640 |
641 memset(s->qscale_table, (FFMAX(s->qmat[0][0][1], s->qmat[0][1][1])+8)/16, 512); //FIXME finetune | 641 memset(s->qscale_table, (FFMAX(s->qmat[0][0][1], s->qmat[0][1][1])+8)/16, 512); //FIXME finetune |
1727 for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) { | 1727 for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) { |
1728 filter_value = | 1728 filter_value = |
1729 (first_pixel[-2] - first_pixel[ 1]) | 1729 (first_pixel[-2] - first_pixel[ 1]) |
1730 +3*(first_pixel[ 0] - first_pixel[-1]); | 1730 +3*(first_pixel[ 0] - first_pixel[-1]); |
1731 filter_value = bounding_values[(filter_value + 4) >> 3]; | 1731 filter_value = bounding_values[(filter_value + 4) >> 3]; |
1732 first_pixel[-1] = clip_uint8(first_pixel[-1] + filter_value); | 1732 first_pixel[-1] = av_clip_uint8(first_pixel[-1] + filter_value); |
1733 first_pixel[ 0] = clip_uint8(first_pixel[ 0] - filter_value); | 1733 first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value); |
1734 } | 1734 } |
1735 } | 1735 } |
1736 | 1736 |
1737 static void vertical_filter(unsigned char *first_pixel, int stride, | 1737 static void vertical_filter(unsigned char *first_pixel, int stride, |
1738 int *bounding_values) | 1738 int *bounding_values) |
1744 for (end= first_pixel + 8; first_pixel < end; first_pixel++) { | 1744 for (end= first_pixel + 8; first_pixel < end; first_pixel++) { |
1745 filter_value = | 1745 filter_value = |
1746 (first_pixel[2 * nstride] - first_pixel[ stride]) | 1746 (first_pixel[2 * nstride] - first_pixel[ stride]) |
1747 +3*(first_pixel[0 ] - first_pixel[nstride]); | 1747 +3*(first_pixel[0 ] - first_pixel[nstride]); |
1748 filter_value = bounding_values[(filter_value + 4) >> 3]; | 1748 filter_value = bounding_values[(filter_value + 4) >> 3]; |
1749 first_pixel[nstride] = clip_uint8(first_pixel[nstride] + filter_value); | 1749 first_pixel[nstride] = av_clip_uint8(first_pixel[nstride] + filter_value); |
1750 first_pixel[0] = clip_uint8(first_pixel[0] - filter_value); | 1750 first_pixel[0] = av_clip_uint8(first_pixel[0] - filter_value); |
1751 } | 1751 } |
1752 } | 1752 } |
1753 | 1753 |
1754 static void apply_loop_filter(Vp3DecodeContext *s) | 1754 static void apply_loop_filter(Vp3DecodeContext *s) |
1755 { | 1755 { |