1 /*
2 * Copyright (c) 2003 Michael Niedermayer
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /**
22 * @file
23 * ASUS V1/V2 encoder.
24 */
25
28
34
37 }
38
40 unsigned int index= level + 3;
41
43 else{
46 }
47 }
48
50 unsigned int index= level + 31;
51
53 else{
56 }
57 }
58
60 int i;
61 int nc_count=0;
62
64 block[0]= 0;
65
66 for(i=0; i<10; i++){
68 int ccp=0;
69
70 if( (block[index + 0] = (block[index + 0]*a->
q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
71 if( (block[index + 8] = (block[index + 8]*a->
q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
72 if( (block[index + 1] = (block[index + 1]*a->
q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
73 if( (block[index + 9] = (block[index + 9]*a->
q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
74
75 if(ccp){
76 for(;nc_count; nc_count--)
78
80
85 }else{
86 nc_count++;
87 }
88 }
90 }
91
93 int i;
95
96 for(count=63; count>3; count--){
98
100 break;
101 }
102
103 count >>= 2;
104
107 block[0]= 0;
108
109 for(i=0; i<=
count; i++){
111 int ccp=0;
112
113 if( (block[index + 0] = (block[index + 0]*a->
q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
114 if( (block[index + 8] = (block[index + 8]*a->
q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
115 if( (block[index + 1] = (block[index + 1]*a->
q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
116 if( (block[index + 9] = (block[index + 9]*a->
q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
117
121
122 if(ccp){
127 }
128 }
129 }
130
131 #define MAX_MB_SIZE (30*16*16*3/2/8)
132
134 int i;
135
138 return -1;
139 }
140
142 for(i=0; i<6; i++)
144 }else{
145 for(i=0; i<6; i++)
147 }
148 return 0;
149 }
150
152 int mb_x, int mb_y)
153 {
156 int i;
157
158 uint8_t *ptr_y = frame->
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
161
166 for(i=0; i<4; i++)
168
172 for(i=4; i<6; i++)
174 }
175 }
176
178 const AVFrame *pict,
int *got_packet)
179 {
182 int mb_x, mb_y;
183
187
189
194 }
195 }
196
202 }
203 }
204
207 for(mb_x=0; mb_x<a->
mb_width; mb_x++){
210 }
211 }
213
217
219
222 else{
223 int i;
224 for(i=0; i<4*
size; i++)
226 }
227
230 *got_packet = 1;
231
232 return 0;
233 }
234
237 int i;
239
245
247
249
251
256
257 for(i=0; i<64; i++){
260 }
261
262 return 0;
263 }
264
265 #if CONFIG_ASV1_ENCODER
276 };
277 #endif
278
279 #if CONFIG_ASV2_ENCODER
290 };
291 #endif