2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
33 b
->dst_stride
= Stride
;
39 b
->pre_stride
= Stride
;
46 void vp8_setup_macroblock(MACROBLOCKD
*x
, BLOCKSET bs
)
50 unsigned char **y
, **u
, **v
;
65 for (block
= 0; block
< 16; block
++) /* y blocks */
67 vp8_setup_block(&x
->block
[block
], x
->dst
.y_stride
, y
, x
->dst
.y_stride
,
68 (block
>> 2) * 4 * x
->dst
.y_stride
+ (block
& 3) * 4, bs
);
71 for (block
= 16; block
< 20; block
++) /* U and V blocks */
73 vp8_setup_block(&x
->block
[block
], x
->dst
.uv_stride
, u
, x
->dst
.uv_stride
,
74 ((block
- 16) >> 1) * 4 * x
->dst
.uv_stride
+ (block
& 1) * 4, bs
);
76 vp8_setup_block(&x
->block
[block
+4], x
->dst
.uv_stride
, v
, x
->dst
.uv_stride
,
77 ((block
- 16) >> 1) * 4 * x
->dst
.uv_stride
+ (block
& 1) * 4, bs
);
81 void vp8_setup_block_dptrs(MACROBLOCKD
*x
)
85 for (r
= 0; r
< 4; r
++)
87 for (c
= 0; c
< 4; c
++)
89 x
->block
[r
*4+c
].diff
= &x
->diff
[r
* 4 * 16 + c
* 4];
90 x
->block
[r
*4+c
].predictor
= x
->predictor
+ r
* 4 * 16 + c
* 4;
94 for (r
= 0; r
< 2; r
++)
96 for (c
= 0; c
< 2; c
++)
98 x
->block
[16+r
*2+c
].diff
= &x
->diff
[256 + r
* 4 * 8 + c
* 4];
99 x
->block
[16+r
*2+c
].predictor
= x
->predictor
+ 256 + r
* 4 * 8 + c
* 4;
104 for (r
= 0; r
< 2; r
++)
106 for (c
= 0; c
< 2; c
++)
108 x
->block
[20+r
*2+c
].diff
= &x
->diff
[320+ r
* 4 * 8 + c
* 4];
109 x
->block
[20+r
*2+c
].predictor
= x
->predictor
+ 320 + r
* 4 * 8 + c
* 4;
114 x
->block
[24].diff
= &x
->diff
[384];
116 for (r
= 0; r
< 25; r
++)
118 x
->block
[r
].qcoeff
= x
->qcoeff
+ r
* 16;
119 x
->block
[r
].dqcoeff
= x
->dqcoeff
+ r
* 16;
123 void vp8_build_block_doffsets(MACROBLOCKD
*x
)
126 /* handle the destination pitch features */
127 vp8_setup_macroblock(x
, DEST
);
128 vp8_setup_macroblock(x
, PRED
);