1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include <stdint.h>
20 #include <string.h>
21
24
26
29 {
31
32 /* compute max_level[], max_run[] and index_run[] */
33 for (last = 0; last < 2; last++) {
34 int8_t *max_level = static_store[last];
35 int8_t *max_run = static_store[last] +
MAX_RUN + 1;
37 if (last == 0) {
38 start = 0;
40 } else {
43 }
44
45 memset(index_run, rl->
n,
MAX_RUN + 1);
46 for (
i = start;
i < end;
i++) {
49 if (index_run[
run] == rl->
n)
55 }
59 }
60 }
61
63 {
69
70 for (q = 0; q < 32; q++) {
71 int qmul = q * 2;
72 int qadd = (q - 1) | 1;
73
75 return;
76
77 if (q == 0) {
78 qmul = 1;
79 qadd = 0;
80 }
85
86 if (
len == 0) {
// illegal code
89 }
else if (
len < 0) {
// more bits needed
92 } else {
93 if (
code == rl->
n) {
// esc
96 } else {
100 }
101 }
105 }
106 }
107 }