#include "libavutil/avassert.h"
-static av_always_inline int fetch_diagonal_mv(H264Context *h, H264SliceContext *sl,
+static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl,
const int16_t **C,
int i, int list, int part_width)
{
AV_ZERO32(sl->mv_cache[list][scan8[0] - 2]);
*C = sl->mv_cache[list][scan8[0] - 2];
- if (!MB_FIELD(h) && IS_INTERLACED(sl->left_type[0])) {
+ if (!MB_FIELD(sl) && IS_INTERLACED(sl->left_type[0])) {
SET_DIAG_MV(* 2, >> 1, sl->left_mb_xy[0] + h->mb_stride,
(sl->mb_y & 1) * 2 + (i >> 5));
}
- if (MB_FIELD(h) && !IS_INTERLACED(sl->left_type[0])) {
+ if (MB_FIELD(sl) && !IS_INTERLACED(sl->left_type[0])) {
// left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK.
SET_DIAG_MV(/ 2, << 1, sl->left_mb_xy[i >= 36], ((i >> 2)) & 3);
}
* @param mx the x component of the predicted motion vector
* @param my the y component of the predicted motion vector
*/
-static av_always_inline void pred_motion(H264Context *const h,
+static av_always_inline void pred_motion(const H264Context *const h,
H264SliceContext *sl,
int n,
int part_width, int list, int ref,
* @param mx the x component of the predicted motion vector
* @param my the y component of the predicted motion vector
*/
-static av_always_inline void pred_16x8_motion(H264Context *const h,
+static av_always_inline void pred_16x8_motion(const H264Context *const h,
H264SliceContext *sl,
int n, int list, int ref,
int *const mx, int *const my)
* @param mx the x component of the predicted motion vector
* @param my the y component of the predicted motion vector
*/
-static av_always_inline void pred_8x16_motion(H264Context *const h,
+static av_always_inline void pred_8x16_motion(const H264Context *const h,
H264SliceContext *sl,
int n, int list, int ref,
int *const mx, int *const my)
#define FIX_MV_MBAFF(type, refn, mvn, idx) \
if (FRAME_MBAFF(h)) { \
- if (MB_FIELD(h)) { \
+ if (MB_FIELD(sl)) { \
if (!IS_INTERLACED(type)) { \
refn <<= 1; \
AV_COPY32(mvbuf[idx], mvn); \
} \
}
-static av_always_inline void pred_pskip_motion(H264Context *const h,
+static av_always_inline void pred_pskip_motion(const H264Context *const h,
H264SliceContext *sl)
{
DECLARE_ALIGNED(4, static const int16_t, zeromv)[2] = { 0 };
return;
}
-static void fill_decode_neighbors(H264Context *h, H264SliceContext *sl, int mb_type)
+static void fill_decode_neighbors(const H264Context *h, H264SliceContext *sl, int mb_type)
{
const int mb_xy = sl->mb_xy;
int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
sl->topleft_partition = -1;
- top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
+ top_xy = mb_xy - (h->mb_stride << MB_FIELD(sl));
/* Wow, what a mess, why didn't they simplify the interlacing & intra
* stuff, I can't imagine that these complex rules are worth it. */
sl->topright_type = 0;
}
-static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type)
+static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int mb_type)
{
int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS];
int topleft_type, top_type, topright_type, left_type[LEFT_MBS];
MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT])
if (FRAME_MBAFF(h)) {
- if (MB_FIELD(h)) {
+ if (MB_FIELD(sl)) {
#define MAP_F2F(idx, mb_type) \
if (!IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \
/**
* decodes a P_SKIP or B_SKIP macroblock
*/
-static void av_unused decode_mb_skip(H264Context *h, H264SliceContext *sl)
+static void av_unused decode_mb_skip(const H264Context *h, H264SliceContext *sl)
{
const int mb_xy = sl->mb_xy;
int mb_type = 0;
memset(h->non_zero_count[mb_xy], 0, 48);
- if (MB_FIELD(h))
+ if (MB_FIELD(sl))
mb_type |= MB_TYPE_INTERLACED;
if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {