76 for (y = 0; y <
height; y++) {
78 memset(plane, 0, width);
80 for (x = 0; x <
width; x++)
98 for (x = 0; x <
width; x++) {
100 for (y = 0; y <
height; y++)
103 for (y = 0; y <
height; y++)
120 int imode, x, y, code, offset;
121 uint8_t invert, *planep =
data;
138 if ((height * width) & 1) {
145 for (y = offset; y < height *
width; y += 2) {
147 *planep++ = code & 1;
149 if (offset == width) {
151 planep += stride -
width;
153 *planep++ = code >> 1;
155 if (offset == width) {
157 planep += stride -
width;
163 if (!(height % 3) && (width % 3)) {
164 for (y = 0; y <
height; y += 3) {
165 for (x = width & 1; x <
width; x += 2) {
171 planep[x + 0] = (code >> 0) & 1;
172 planep[x + 1] = (code >> 1) & 1;
173 planep[x + 0 +
stride] = (code >> 2) & 1;
174 planep[x + 1 +
stride] = (code >> 3) & 1;
175 planep[x + 0 + stride * 2] = (code >> 4) & 1;
176 planep[x + 1 + stride * 2] = (code >> 5) & 1;
178 planep += stride * 3;
183 planep += (height & 1) * stride;
184 for (y = height & 1; y <
height; y += 2) {
185 for (x = width % 3; x <
width; x += 3) {
191 planep[x + 0] = (code >> 0) & 1;
192 planep[x + 1] = (code >> 1) & 1;
193 planep[x + 2] = (code >> 2) & 1;
194 planep[x + 0 +
stride] = (code >> 3) & 1;
195 planep[x + 1 +
stride] = (code >> 4) & 1;
196 planep[x + 2 +
stride] = (code >> 5) & 1;
198 planep += stride * 2;
221 for (x = 1; x <
width; x++)
222 planep[x] ^= planep[x-1];
223 for (y = 1; y <
height; y++) {
225 planep[0] ^= planep[-
stride];
226 for (x = 1; x <
width; x++) {
227 if (planep[x-1] != planep[x-stride]) planep[x] ^= invert;
228 else planep[x] ^= planep[x-1];
233 for (x = 0; x < stride *
height; x++)
234 planep[x] = !planep[x];
236 return (imode << 1) + invert;
313 "Old interlaced mode is not supported\n");
325 "LOOPFILTER shall not be enabled in Simple Profile\n");
347 "FASTUVMC unavailable in Simple Profile\n");
354 "Extended MVs unavailable in Simple Profile\n");
364 "1 for reserved RES_TRANSTAB is forbidden\n");
374 "RANGERED should be set to 0 in Simple Profile\n");
400 "Old WMV3 version detected, some frames may be decoded incorrectly\n");
407 "Profile %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
408 "LoopFilter=%i, MultiRes=%i, FastUVMC=%i, Extended MV=%i\n"
409 "Rangered=%i, VSTransform=%i, Overlap=%i, SyncMarker=%i\n"
410 "DQuant=%i, Quantizer mode=%i, Max B frames=%i\n",
428 "Only 4:2:0 chroma format supported\n");
449 "Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
450 "LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n"
451 "TFCTRflag=%i, FINTERPflag=%i\n",
472 }
else if (ar == 15) {
495 if (nr > 0 && nr < 8 && dr > 0 && dr < 3) {
561 av_log(avctx,
AV_LOG_ERROR,
"Chroma scaling is not supported, expect wrong picture\n");
566 "BrokenLink=%i, ClosedEntry=%i, PanscanFlag=%i\n"
567 "RefDist=%i, Postproc=%i, FastUVMC=%i, ExtMV=%i\n"
568 "DQuant=%i, VSTransform=%i, Overlap=%i, Qmode=%i\n",
577 int pqindex, lowquant, status;
664 lowquant = (v->
pq > 12) ? 0 : 1;
675 shift = (255 - v->
lumshift * 2) << 6;
685 for (i = 0; i < 256; i++) {
686 v->
luty[i] = av_clip_uint8((scale * i + shift + 32) >> 6);
687 v->
lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);
709 "Imode: %i, Invert: %i\n", status>>1, status&1);
718 "Imode: %i, Invert: %i\n", status>>1, status&1);
754 "Imode: %i, Invert: %i\n", status>>1, status&1);
759 "Imode: %i, Invert: %i\n", status>>1, status&1);
800 #define INIT_LUT(lumscale, lumshift, luty, lutuv) \
803 shift = (255 - lumshift * 2) << 6; \
807 scale = lumscale + 32; \
809 shift = (lumshift - 64) << 6; \
811 shift = lumshift << 6; \
813 for (i = 0; i < 256; i++) { \
814 luty[i] = av_clip_uint8((scale * i + shift + 32) >> 6); \
815 lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6); \
820 int pqindex, lowquant;
822 int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab;
832 goto parse_common_info;
843 "Interlaced frames/fields support is incomplete\n");
912 goto parse_common_info;
965 "Imode: %i, Invert: %i\n", status>>1, status&1);
971 "Imode: %i, Invert: %i\n", status>>1, status&1);
980 "Imode: %i, Invert: %i\n", status>>1, status&1);
1011 "Imode: %i, Invert: %i\n", status>>1, status&1);
1037 else if (v->
pq < 13)
1044 lowquant = (v->
pq > 12) ? 0 : 1;
1084 "Imode: %i, Invert: %i\n", status>>1, status&1);
1093 "Imode: %i, Invert: %i\n", status>>1, status&1);
1151 else if (v->
pq < 13)
1161 lowquant = (v->
pq > 12) ? 0 : 1;
1170 "Imode: %i, Invert: %i\n", status>>1, status&1);
1194 "Imode: %i, Invert: %i\n", status>>1, status&1);
1199 "Imode: %i, Invert: %i\n", status>>1, status&1);