67 const int linesize = frame->
linesize[0];
70 int left[3], top[3], topleft[3];
73 for (i = 0; i < 3; i++)
74 buffer[0][i] = 1 << (9 - 1);
76 for (y = 0; y <
height; y++) {
77 const int modified_predictor = y ? predictor : 1;
85 for (i = 0; i < 3; i++)
86 top[i]= left[i]= topleft[i]=
buffer[0][i];
88 for (x = 0; x <
width; x++) {
90 buffer[x][1] = ptr[3 * x + 0] - ptr[3 * x + 1] + 0x100;
91 buffer[x][2] = ptr[3 * x + 2] - ptr[3 * x + 1] + 0x100;
92 buffer[x][0] = (ptr[3 * x + 0] + 2 * ptr[3 * x + 1] + ptr[3 * x + 2]) >> 2;
94 buffer[x][1] = ptr[4 * x + 0] - ptr[4 * x + 1] + 0x100;
95 buffer[x][2] = ptr[4 * x + 2] - ptr[4 * x + 1] + 0x100;
96 buffer[x][0] = (ptr[4 * x + 0] + 2 * ptr[4 * x + 1] + ptr[4 * x + 2]) >> 2;
99 for (i = 0; i < 3; i++) {
102 PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
109 diff = ((left[i] - pred + 0x100) & 0x1FF) - 0x100;
128 if (mb_x == 0 || mb_y == 0) {
129 for (i = 0; i < 3; i++) {
131 int x,
y, h,
v, linesize;
136 for (y = 0; y <
v; y++) {
137 for (x = 0; x < h; x++) {
140 ptr = frame->
data[i] + (linesize * (v * mb_y +
y)) + (h * mb_x + x);
141 if (y == 0 && mb_y == 0) {
142 if (x == 0 && mb_x == 0)
147 if (x == 0 && mb_x == 0) {
148 pred = ptr[-linesize];
150 PREDICT(pred, ptr[-linesize - 1], ptr[-linesize],
163 for (i = 0; i < 3; i++) {
165 int x,
y, h,
v, linesize;
170 for (y = 0; y <
v; y++) {
171 for (x = 0; x < h; x++) {
174 ptr = frame->
data[i] + (linesize * (v * mb_y +
y)) + (h * mb_x + x);
175 PREDICT(pred, ptr[-linesize - 1], ptr[-linesize], ptr[-1], predictor);
196 for (mb_y = 0; mb_y < mb_height; mb_y++) {
203 for (mb_x = 0; mb_x < mb_width; mb_x++)
211 const AVFrame *pict,
int *got_packet)
218 const int mb_height = (height + s->
vsample[0] - 1) / s->
vsample[0];
220 int ret, header_bits;
225 max_pkt_size += width * height * 3 * 4;
227 max_pkt_size += mb_width * mb_height * 3 * 4
283 "Limited range YUV is non-standard, set strict_std_compliance to "
284 "at least unofficial to use it.\n");