| OLD | NEW |
| (Empty) | |
| 1 commit 65b567e7b7a1f2687baee2e4e53bf537013d2477 |
| 2 Author: reimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b> |
| 3 Date: Sun Jul 5 18:25:58 2009 +0000 |
| 4 |
| 5 Extend init_loop_filter to work for filter limit values up to 127 instead |
| 6 of only up to 64. 127 is the maximum value allowed by the theora specificati
on. |
| 7 |
| 8 |
| 9 git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19350 9553f0bf-9b14-
0410-a0b8-cfaf0461ba5b |
| 10 |
| 11 diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c |
| 12 index 7612851..66ac2f9 100644 |
| 13 --- a/libavcodec/vp3.c |
| 14 +++ b/libavcodec/vp3.c |
| 15 @@ -517,23 +517,30 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi) |
| 16 /* |
| 17 * This function initializes the loop filter boundary limits if the frame's |
| 18 * quality index is different from the previous frame's. |
| 19 + * |
| 20 + * The filter_limit_values may not be larger than 127. |
| 21 */ |
| 22 static void init_loop_filter(Vp3DecodeContext *s) |
| 23 { |
| 24 int *bounding_values= s->bounding_values_array+127; |
| 25 int filter_limit; |
| 26 int x; |
| 27 + int value; |
| 28 |
| 29 filter_limit = s->filter_limit_values[s->qps[0]]; |
| 30 |
| 31 /* set up the bounding values */ |
| 32 memset(s->bounding_values_array, 0, 256 * sizeof(int)); |
| 33 for (x = 0; x < filter_limit; x++) { |
| 34 - bounding_values[-x - filter_limit] = -filter_limit + x; |
| 35 bounding_values[-x] = -x; |
| 36 bounding_values[x] = x; |
| 37 - bounding_values[x + filter_limit] = filter_limit - x; |
| 38 } |
| 39 + for (x = value = filter_limit; x < 128 && value; x++, value--) { |
| 40 + bounding_values[ x] = value; |
| 41 + bounding_values[-x] = -value; |
| 42 + } |
| 43 + if (value) |
| 44 + bounding_values[128] = value; |
| 45 bounding_values[129] = bounding_values[130] = filter_limit * 0x02020202; |
| 46 } |
| 47 |
| OLD | NEW |