Lines Matching refs:plane

197                          int width, int linesize, int plane)
224 for (i = 0; i < FF_ARRAY_ELEMS(s->plane); i++) {
225 Plane *p = &s->plane[i];
226 av_freep(&s->plane[i].idwt_buf);
227 av_freep(&s->plane[i].idwt_tmp);
228 s->plane[i].idwt_size = 0;
231 s->plane[i].subband[j] = NULL;
234 s->plane[i].l_h[j] = NULL;
280 s->plane[i].width = width;
281 s->plane[i].height = height;
282 s->plane[i].stride = stride;
284 w8 = FFALIGN(s->plane[i].width / 8, 8) + 64;
292 s->plane[i].idwt_size = FFALIGN(height, 8) * stride;
293 s->plane[i].idwt_buf =
294 av_calloc(s->plane[i].idwt_size, sizeof(*s->plane[i].idwt_buf));
295 s->plane[i].idwt_tmp =
296 av_malloc_array(s->plane[i].idwt_size, sizeof(*s->plane[i].idwt_tmp));
298 s->plane[i].idwt_size = FFALIGN(height, 8) * stride * 2;
299 s->plane[i].idwt_buf =
300 av_calloc(s->plane[i].idwt_size, sizeof(*s->plane[i].idwt_buf));
301 s->plane[i].idwt_tmp =
302 av_malloc_array(s->plane[i].idwt_size, sizeof(*s->plane[i].idwt_tmp));
305 if (!s->plane[i].idwt_buf || !s->plane[i].idwt_tmp)
308 s->plane[i].subband[0] = s->plane[i].idwt_buf;
309 s->plane[i].subband[1] = s->plane[i].idwt_buf + 2 * w8 * h8;
310 s->plane[i].subband[2] = s->plane[i].idwt_buf + 1 * w8 * h8;
311 s->plane[i].subband[3] = s->plane[i].idwt_buf + 3 * w8 * h8;
312 s->plane[i].subband[4] = s->plane[i].idwt_buf + 2 * w4 * h4;
313 s->plane[i].subband[5] = s->plane[i].idwt_buf + 1 * w4 * h4;
314 s->plane[i].subband[6] = s->plane[i].idwt_buf + 3 * w4 * h4;
316 s->plane[i].subband[7] = s->plane[i].idwt_buf + 2 * w2 * h2;
317 s->plane[i].subband[8] = s->plane[i].idwt_buf + 1 * w2 * h2;
318 s->plane[i].subband[9] = s->plane[i].idwt_buf + 3 * w2 * h2;
321 s->plane[i].subband[7] = s->plane[i].idwt_buf + 4 * w2 * h2;
322 s->plane[i].subband[8] = frame2 + 2 * w4 * h4;
323 s->plane[i].subband[9] = frame2 + 1 * w4 * h4;
324 s->plane[i].subband[10] = frame2 + 3 * w4 * h4;
325 s->plane[i].subband[11] = frame2 + 2 * w2 * h2;
326 s->plane[i].subband[12] = frame2 + 1 * w2 * h2;
327 s->plane[i].subband[13] = frame2 + 3 * w2 * h2;
328 s->plane[i].subband[14] = s->plane[i].idwt_buf + 2 * w2 * h2;
329 s->plane[i].subband[15] = s->plane[i].idwt_buf + 1 * w2 * h2;
330 s->plane[i].subband[16] = s->plane[i].idwt_buf + 3 * w2 * h2;
335 for (k = 0; k < FF_ARRAY_ELEMS(s->plane[i].band[j]); k++) {
336 s->plane[i].band[j][k].a_width = w8 << j;
337 s->plane[i].band[j][k].a_height = h8 << j;
344 for (k = 0; k < FF_ARRAY_ELEMS(s->plane[i].band[j]); k++) {
345 s->plane[i].band[j][k].a_width = w8 << t;
346 s->plane[i].band[j][k].a_height = h8 << t;
352 s->plane[i].l_h[0] = s->plane[i].idwt_tmp;
353 s->plane[i].l_h[1] = s->plane[i].idwt_tmp + 2 * w8 * h8;
354 // s->plane[i].l_h[2] = ll2;
355 s->plane[i].l_h[3] = s->plane[i].idwt_tmp;
356 s->plane[i].l_h[4] = s->plane[i].idwt_tmp + 2 * w4 * h4;
357 // s->plane[i].l_h[5] = ll1;
358 s->plane[i].l_h[6] = s->plane[i].idwt_tmp;
359 s->plane[i].l_h[7] = s->plane[i].idwt_tmp + 2 * w2 * h2;
361 int16_t *frame2 = s->plane[i].idwt_tmp + 4 * w2 * h2;
363 s->plane[i].l_h[8] = frame2;
364 s->plane[i].l_h[9] = frame2 + 2 * w2 * h2;
382 int ret = 0, i, j, plane, got_buffer = 0;
493 s->plane[s->channel_num].band[0][0].width = data;
494 s->plane[s->channel_num].band[0][0].stride = data;
497 s->plane[s->channel_num].band[0][0].height = data;
543 s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
544 s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
552 s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
560 s->plane[s->channel_num].band[s->level][s->subband_num].width = data;
561 s->plane[s->channel_num].band[s->level][s->subband_num].stride = FFALIGN(data, 8);
569 s->plane[s->channel_num].band[s->level][s->subband_num].height = data;
640 int lowpass_height = s->plane[s->channel_num].band[0][0].height;
641 int lowpass_width = s->plane[s->channel_num].band[0][0].width;
705 coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual];
716 lowpass_height = s->plane[s->channel_num].band[0][0].height;
717 lowpass_width = s->plane[s->channel_num].band[0][0].width;
718 lowpass_a_height = s->plane[s->channel_num].band[0][0].a_height;
719 lowpass_a_width = s->plane[s->channel_num].band[0][0].a_width;
766 s->plane[s->channel_num].band[0][0].read_ok = 1;
783 highpass_height = s->plane[s->channel_num].band[s->level][s->subband_num].height;
784 highpass_width = s->plane[s->channel_num].band[s->level][s->subband_num].width;
785 highpass_a_width = s->plane[s->channel_num].band[s->level][s->subband_num].a_width;
786 highpass_a_height = s->plane[s->channel_num].band[s->level][s->subband_num].a_height;
787 highpass_stride = s->plane[s->channel_num].band[s->level][s->subband_num].stride;
803 av_log(avctx, AV_LOG_DEBUG, "Start subband coeffs plane %i level %i codebook %i expected %i\n", s->channel_num, s->level, s->codebook, expected);
889 difference_coding(s->plane[s->channel_num].subband[s->subband_num_actual], highpass_width, highpass_height);
900 s->plane[s->channel_num].band[s->level][s->subband_num].read_ok = 1;
929 for (plane = 0; plane < s->planes; plane++) {
937 if (!s->plane[plane].band[level][o].read_ok) {
946 for (plane = 0; plane < s->planes && !ret; plane++) {
948 int lowpass_height = s->plane[plane].band[0][0].height;
949 int output_stride = s->plane[plane].band[0][0].a_width;
950 int lowpass_width = s->plane[plane].band[0][0].width;
951 int highpass_stride = s->plane[plane].band[0][1].stride;
952 int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane;
963 if (lowpass_height > s->plane[plane].band[0][0].a_height || lowpass_width > s->plane[plane].band[0][0].a_width ||
964 !highpass_stride || s->plane[plane].band[0][1].width > s->plane[plane].band[0][1].a_width ||
966 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
971 av_log(avctx, AV_LOG_DEBUG, "Decoding level 1 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
973 low = s->plane[plane].subband[0];
974 high = s->plane[plane].subband[2];
975 output = s->plane[plane].l_h[0];
978 low = s->plane[plane].subband[1];
979 high = s->plane[plane].subband[3];
980 output = s->plane[plane].l_h[1];
984 low = s->plane[plane].l_h[0];
985 high = s->plane[plane].l_h[1];
986 output = s->plane[plane].subband[0];
989 output = s->plane[plane].subband[0];
999 lowpass_height = s->plane[plane].band[1][1].height;
1000 output_stride = s->plane[plane].band[1][1].a_width;
1001 lowpass_width = s->plane[plane].band[1][1].width;
1002 highpass_stride = s->plane[plane].band[1][1].stride;
1004 if (lowpass_height > s->plane[plane].band[1][1].a_height || lowpass_width > s->plane[plane].band[1][1].a_width ||
1005 !highpass_stride || s->plane[plane].band[1][1].width > s->plane[plane].band[1][1].a_width ||
1007 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1012 av_log(avctx, AV_LOG_DEBUG, "Level 2 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1014 low = s->plane[plane].subband[0];
1015 high = s->plane[plane].subband[5];
1016 output = s->plane[plane].l_h[3];
1019 low = s->plane[plane].subband[4];
1020 high = s->plane[plane].subband[6];
1021 output = s->plane[plane].l_h[4];
1024 low = s->plane[plane].l_h[3];
1025 high = s->plane[plane].l_h[4];
1026 output = s->plane[plane].subband[0];
1029 output = s->plane[plane].subband[0];
1038 lowpass_height = s->plane[plane].band[2][1].height;
1039 output_stride = s->plane[plane].band[2][1].a_width;
1040 lowpass_width = s->plane[plane].band[2][1].width;
1041 highpass_stride = s->plane[plane].band[2][1].stride;
1043 if (lowpass_height > s->plane[plane].band[2][1].a_height || lowpass_width > s->plane[plane].band[2][1].a_width ||
1044 !highpass_stride || s->plane[plane].band[2][1].width > s->plane[plane].band[2][1].a_width ||
1045 lowpass_height < 3 || lowpass_width < 3 || lowpass_width * 2 > s->plane[plane].width) {
1046 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1051 av_log(avctx, AV_LOG_DEBUG, "Level 3 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1053 low = s->plane[plane].subband[0];
1054 high = s->plane[plane].subband[8];
1055 output = s->plane[plane].l_h[6];
1058 low = s->plane[plane].subband[7];
1059 high = s->plane[plane].subband[9];
1060 output = s->plane[plane].l_h[7];
1065 if (plane & 1)
1067 if (plane > 1)
1070 low = s->plane[plane].l_h[6];
1071 high = s->plane[plane].l_h[7];
1081 for (i = 0; i < s->plane[act_plane].height; i++) {
1092 low = s->plane[plane].subband[0];
1093 high = s->plane[plane].subband[7];
1094 output = s->plane[plane].l_h[6];
1097 low = s->plane[plane].subband[8];
1098 high = s->plane[plane].subband[9];
1099 output = s->plane[plane].l_h[7];
1103 low = s->plane[plane].l_h[6];
1104 high = s->plane[plane].l_h[7];
1105 for (i = 0; i < s->plane[act_plane].height / 2; i++) {
1114 for (plane = 0; plane < s->planes && !ret; plane++) {
1115 int lowpass_height = s->plane[plane].band[0][0].height;
1116 int output_stride = s->plane[plane].band[0][0].a_width;
1117 int lowpass_width = s->plane[plane].band[0][0].width;
1118 int highpass_stride = s->plane[plane].band[0][1].stride;
1119 int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane;
1130 if (lowpass_height > s->plane[plane].band[0][0].a_height || lowpass_width > s->plane[plane].band[0][0].a_width ||
1131 !highpass_stride || s->plane[plane].band[0][1].width > s->plane[plane].band[0][1].a_width ||
1133 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1138 av_log(avctx, AV_LOG_DEBUG, "Decoding level 1 plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1140 low = s->plane[plane].subband[0];
1141 high = s->plane[plane].subband[2];
1142 output = s->plane[plane].l_h[0];
1145 low = s->plane[plane].subband[1];
1146 high = s->plane[plane].subband[3];
1147 output = s->plane[plane].l_h[1];
1150 low = s->plane[plane].l_h[0];
1151 high = s->plane[plane].l_h[1];
1152 output = s->plane[plane].l_h[7];
1155 output = s->plane[plane].l_h[7];
1164 lowpass_height = s->plane[plane].band[1][1].height;
1165 output_stride = s->plane[plane].band[1][1].a_width;
1166 lowpass_width = s->plane[plane].band[1][1].width;
1167 highpass_stride = s->plane[plane].band[1][1].stride;
1169 if (lowpass_height > s->plane[plane].band[1][1].a_height || lowpass_width > s->plane[plane].band[1][1].a_width ||
1170 !highpass_stride || s->plane[plane].band[1][1].width > s->plane[plane].band[1][1].a_width ||
1172 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1177 av_log(avctx, AV_LOG_DEBUG, "Level 2 lowpass plane %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1179 low = s->plane[plane].l_h[7];
1180 high = s->plane[plane].subband[5];
1181 output = s->plane[plane].l_h[3];
1184 low = s->plane[plane].subband[4];
1185 high = s->plane[plane].subband[6];
1186 output = s->plane[plane].l_h[4];
1189 low = s->plane[plane].l_h[3];
1190 high = s->plane[plane].l_h[4];
1191 output = s->plane[plane].l_h[7];
1194 output = s->plane[plane].l_h[7];
1201 low = s->plane[plane].subband[7];
1202 high = s->plane[plane].subband[9];
1203 output = s->plane[plane].l_h[3];
1206 low = s->plane[plane].subband[8];
1207 high = s->plane[plane].subband[10];
1208 output = s->plane[plane].l_h[4];
1211 low = s->plane[plane].l_h[3];
1212 high = s->plane[plane].l_h[4];
1213 output = s->plane[plane].l_h[9];
1216 lowpass_height = s->plane[plane].band[4][1].height;
1217 output_stride = s->plane[plane].band[4][1].a_width;
1218 lowpass_width = s->plane[plane].band[4][1].width;
1219 highpass_stride = s->plane[plane].band[4][1].stride;
1220 av_log(avctx, AV_LOG_DEBUG, "temporal level %i %i %i %i\n", plane, lowpass_height, lowpass_width, highpass_stride);
1222 if (lowpass_height > s->plane[plane].band[4][1].a_height || lowpass_width > s->plane[plane].band[4][1].a_width ||
1223 !highpass_stride || s->plane[plane].band[4][1].width > s->plane[plane].band[4][1].a_width ||
1225 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1230 low = s->plane[plane].l_h[7];
1231 high = s->plane[plane].l_h[9];
1232 output = s->plane[plane].l_h[7];
1239 low = s->plane[plane].l_h[7];
1240 high = s->plane[plane].subband[15];
1241 output = s->plane[plane].l_h[6];
1244 low = s->plane[plane].subband[14];
1245 high = s->plane[plane].subband[16];
1246 output = s->plane[plane].l_h[7];
1249 low = s->plane[plane].l_h[9];
1250 high = s->plane[plane].subband[12];
1251 output = s->plane[plane].l_h[8];
1254 low = s->plane[plane].subband[11];
1255 high = s->plane[plane].subband[13];
1256 output = s->plane[plane].l_h[9];
1264 if (plane & 1)
1266 if (plane > 1)
1278 low = s->plane[plane].l_h[6];
1279 high = s->plane[plane].l_h[7];
1280 for (i = 0; i < s->plane[act_plane].height; i++) {
1288 low = s->plane[plane].l_h[7];
1289 high = s->plane[plane].subband[14];
1290 output = s->plane[plane].l_h[6];
1293 low = s->plane[plane].subband[15];
1294 high = s->plane[plane].subband[16];
1295 output = s->plane[plane].l_h[7];
1298 low = s->plane[plane].l_h[9];
1299 high = s->plane[plane].subband[11];
1300 output = s->plane[plane].l_h[8];
1303 low = s->plane[plane].subband[12];
1304 high = s->plane[plane].subband[13];
1305 output = s->plane[plane].l_h[9];
1312 low = s->plane[plane].l_h[6];
1313 high = s->plane[plane].l_h[7];
1314 for (i = 0; i < s->plane[act_plane].height / 2; i++) {
1329 for (plane = 0; plane < s->planes; plane++) {
1330 int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane;
1339 lowpass_height = s->plane[plane].band[4][1].height;
1340 output_stride = s->plane[plane].band[4][1].a_width;
1341 lowpass_width = s->plane[plane].band[4][1].width;
1343 if (lowpass_height > s->plane[plane].band[4][1].a_height || lowpass_width > s->plane[plane].band[4][1].a_width ||
1344 s->plane[plane].band[4][1].width > s->plane[plane].band[4][1].a_width ||
1346 av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n");
1353 low = s->plane[plane].l_h[8];
1354 high = s->plane[plane].l_h[9];
1357 if (plane & 1)
1359 if (plane > 1)
1371 for (i = 0; i < s->plane[act_plane].height; i++) {
1379 low = s->plane[plane].l_h[8];
1380 high = s->plane[plane].l_h[9];
1381 for (i = 0; i < s->plane[act_plane].height / 2; i++) {
1423 if (pdst->plane[0].idwt_size != psrc->plane[0].idwt_size ||
1438 if (!pdst->plane[0].idwt_buf) {
1448 for (int plane = 0; plane < pdst->planes; plane++) {
1449 memcpy(pdst->plane[plane].band, psrc->plane[plane].band, sizeof(pdst->plane[plane].band));
1450 memcpy(pdst->plane[plane].idwt_buf, psrc->plane[plane].idwt_buf,
1451 pdst->plane[plane].idwt_size * sizeof(int16_t));