66 const int linesize = frame->
linesize[0];
69 int left[3], top[3], topleft[3];
72 for (i = 0; i < 3; i++)
73 buffer[0][i] = 1 << (9 - 1);
75 for (y = 0; y <
height; y++) {
76 const int modified_predictor = y ? predictor : 1;
84 for (i = 0; i < 3; i++)
85 top[i]= left[i]= topleft[i]=
buffer[0][i];
87 for (x = 0; x <
width; x++) {
89 buffer[x][1] = ptr[3 * x + 0] - ptr[3 * x + 1] + 0x100;
90 buffer[x][2] = ptr[3 * x + 2] - ptr[3 * x + 1] + 0x100;
91 buffer[x][0] = (ptr[3 * x + 0] + 2 * ptr[3 * x + 1] + ptr[3 * x + 2]) >> 2;
93 buffer[x][1] = ptr[4 * x + 0] - ptr[4 * x + 1] + 0x100;
94 buffer[x][2] = ptr[4 * x + 2] - ptr[4 * x + 1] + 0x100;
95 buffer[x][0] = (ptr[4 * x + 0] + 2 * ptr[4 * x + 1] + ptr[4 * x + 2]) >> 2;
98 for (i = 0; i < 3; i++) {
101 PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
108 diff = ((left[i] - pred + 0x100) & 0x1FF) - 0x100;
127 if (mb_x == 0 || mb_y == 0) {
128 for (i = 0; i < 3; i++) {
130 int x,
y, h,
v, linesize;
135 for (y = 0; y <
v; y++) {
136 for (x = 0; x < h; x++) {
139 ptr = frame->
data[i] + (linesize * (v * mb_y +
y)) + (h * mb_x + x);
140 if (y == 0 && mb_y == 0) {
141 if (x == 0 && mb_x == 0)
146 if (x == 0 && mb_x == 0) {
147 pred = ptr[-linesize];
149 PREDICT(pred, ptr[-linesize - 1], ptr[-linesize],
162 for (i = 0; i < 3; i++) {
164 int x,
y, h,
v, linesize;
169 for (y = 0; y <
v; y++) {
170 for (x = 0; x < h; x++) {
173 ptr = frame->
data[i] + (linesize * (v * mb_y +
y)) + (h * mb_x + x);
174 PREDICT(pred, ptr[-linesize - 1], ptr[-linesize], ptr[-1], predictor);
195 for (mb_y = 0; mb_y < mb_height; mb_y++) {
202 for (mb_x = 0; mb_x < mb_width; mb_x++)
210 const AVFrame *pict,
int *got_packet)
217 const int mb_height = (height + s->
vsample[0] - 1) / s->
vsample[0];
219 int ret, header_bits;
224 max_pkt_size += width * height * 3 * 4;
226 max_pkt_size += mb_width * mb_height * 3 * 4
281 "Limited range YUV is non-standard, set strict_std_compliance to "
282 "at least unofficial to use it.\n");