Lines Matching +full:k +full:- +full:to +full:- +full:j
1 // SPDX-License-Identifier: GPL-2.0
35 * filter taps taken to 7-bit precision,
36 * reference RFC6386#Page-16, filters[8][6]
40 { 0, -6, 123, 12, -1, 0 },
41 { 2, -11, 108, 36, -8, 1 },
42 { 0, -9, 93, 50, -6, 0 },
43 { 3, -16, 77, 77, -16, 3 },
44 { 0, -6, 50, 93, -9, 0 },
45 { 1, -8, 36, 108, -11, 2 },
46 { 0, -1, 12, 123, -6, 0 }
52 const struct v4l2_vp8_entropy *entropy = &hdr->entropy; in hantro_vp8_prob_update()
53 u32 i, j, k; in hantro_vp8_prob_update() local
57 dst = ctx->vp8_dec.prob_tbl.cpu; in hantro_vp8_prob_update()
59 dst[0] = hdr->prob_skip_false; in hantro_vp8_prob_update()
60 dst[1] = hdr->prob_intra; in hantro_vp8_prob_update()
61 dst[2] = hdr->prob_last; in hantro_vp8_prob_update()
62 dst[3] = hdr->prob_gf; in hantro_vp8_prob_update()
63 dst[4] = hdr->segment.segment_probs[0]; in hantro_vp8_prob_update()
64 dst[5] = hdr->segment.segment_probs[1]; in hantro_vp8_prob_update()
65 dst[6] = hdr->segment.segment_probs[2]; in hantro_vp8_prob_update()
69 dst[0] = entropy->y_mode_probs[0]; in hantro_vp8_prob_update()
70 dst[1] = entropy->y_mode_probs[1]; in hantro_vp8_prob_update()
71 dst[2] = entropy->y_mode_probs[2]; in hantro_vp8_prob_update()
72 dst[3] = entropy->y_mode_probs[3]; in hantro_vp8_prob_update()
73 dst[4] = entropy->uv_mode_probs[0]; in hantro_vp8_prob_update()
74 dst[5] = entropy->uv_mode_probs[1]; in hantro_vp8_prob_update()
75 dst[6] = entropy->uv_mode_probs[2]; in hantro_vp8_prob_update()
80 dst[0] = entropy->mv_probs[0][0]; /* is short */ in hantro_vp8_prob_update()
81 dst[1] = entropy->mv_probs[1][0]; in hantro_vp8_prob_update()
82 dst[2] = entropy->mv_probs[0][1]; /* sign */ in hantro_vp8_prob_update()
83 dst[3] = entropy->mv_probs[1][1]; in hantro_vp8_prob_update()
84 dst[4] = entropy->mv_probs[0][8 + 9]; in hantro_vp8_prob_update()
85 dst[5] = entropy->mv_probs[0][9 + 9]; in hantro_vp8_prob_update()
86 dst[6] = entropy->mv_probs[1][8 + 9]; in hantro_vp8_prob_update()
87 dst[7] = entropy->mv_probs[1][9 + 9]; in hantro_vp8_prob_update()
90 for (j = 0; j < 8; j += 4) { in hantro_vp8_prob_update()
91 dst[0] = entropy->mv_probs[i][j + 9 + 0]; in hantro_vp8_prob_update()
92 dst[1] = entropy->mv_probs[i][j + 9 + 1]; in hantro_vp8_prob_update()
93 dst[2] = entropy->mv_probs[i][j + 9 + 2]; in hantro_vp8_prob_update()
94 dst[3] = entropy->mv_probs[i][j + 9 + 3]; in hantro_vp8_prob_update()
99 dst[0] = entropy->mv_probs[i][0 + 2]; in hantro_vp8_prob_update()
100 dst[1] = entropy->mv_probs[i][1 + 2]; in hantro_vp8_prob_update()
101 dst[2] = entropy->mv_probs[i][2 + 2]; in hantro_vp8_prob_update()
102 dst[3] = entropy->mv_probs[i][3 + 2]; in hantro_vp8_prob_update()
103 dst[4] = entropy->mv_probs[i][4 + 2]; in hantro_vp8_prob_update()
104 dst[5] = entropy->mv_probs[i][5 + 2]; in hantro_vp8_prob_update()
105 dst[6] = entropy->mv_probs[i][6 + 2]; in hantro_vp8_prob_update()
111 dst = ctx->vp8_dec.prob_tbl.cpu; in hantro_vp8_prob_update()
114 for (j = 0; j < 8; ++j) { in hantro_vp8_prob_update()
115 for (k = 0; k < 3; ++k) { in hantro_vp8_prob_update()
116 dst[0] = entropy->coeff_probs[i][j][k][0]; in hantro_vp8_prob_update()
117 dst[1] = entropy->coeff_probs[i][j][k][1]; in hantro_vp8_prob_update()
118 dst[2] = entropy->coeff_probs[i][j][k][2]; in hantro_vp8_prob_update()
119 dst[3] = entropy->coeff_probs[i][j][k][3]; in hantro_vp8_prob_update()
126 dst = ctx->vp8_dec.prob_tbl.cpu; in hantro_vp8_prob_update()
129 for (j = 0; j < 8; ++j) { in hantro_vp8_prob_update()
130 for (k = 0; k < 3; ++k) { in hantro_vp8_prob_update()
131 dst[0] = entropy->coeff_probs[i][j][k][4]; in hantro_vp8_prob_update()
132 dst[1] = entropy->coeff_probs[i][j][k][5]; in hantro_vp8_prob_update()
133 dst[2] = entropy->coeff_probs[i][j][k][6]; in hantro_vp8_prob_update()
134 dst[3] = entropy->coeff_probs[i][j][k][7]; in hantro_vp8_prob_update()
135 dst[4] = entropy->coeff_probs[i][j][k][8]; in hantro_vp8_prob_update()
136 dst[5] = entropy->coeff_probs[i][j][k][9]; in hantro_vp8_prob_update()
137 dst[6] = entropy->coeff_probs[i][j][k][10]; in hantro_vp8_prob_update()
147 struct hantro_dev *vpu = ctx->dev; in hantro_vp8_dec_init()
154 mb_width = DIV_ROUND_UP(ctx->dst_fmt.width, 16); in hantro_vp8_dec_init()
155 mb_height = DIV_ROUND_UP(ctx->dst_fmt.height, 16); in hantro_vp8_dec_init()
160 * And the data in segment map buffer must be set to all zero. in hantro_vp8_dec_init()
162 aux_buf = &ctx->vp8_dec.segment_map; in hantro_vp8_dec_init()
163 aux_buf->size = segment_map_size; in hantro_vp8_dec_init()
164 aux_buf->cpu = dma_alloc_coherent(vpu->dev, aux_buf->size, in hantro_vp8_dec_init()
165 &aux_buf->dma, GFP_KERNEL); in hantro_vp8_dec_init()
166 if (!aux_buf->cpu) in hantro_vp8_dec_init()
167 return -ENOMEM; in hantro_vp8_dec_init()
171 * total 1208 bytes, 4K page is far enough. in hantro_vp8_dec_init()
173 aux_buf = &ctx->vp8_dec.prob_tbl; in hantro_vp8_dec_init()
174 aux_buf->size = sizeof(struct vp8_prob_tbl_packed); in hantro_vp8_dec_init()
175 aux_buf->cpu = dma_alloc_coherent(vpu->dev, aux_buf->size, in hantro_vp8_dec_init()
176 &aux_buf->dma, GFP_KERNEL); in hantro_vp8_dec_init()
177 if (!aux_buf->cpu) { in hantro_vp8_dec_init()
178 ret = -ENOMEM; in hantro_vp8_dec_init()
185 dma_free_coherent(vpu->dev, ctx->vp8_dec.segment_map.size, in hantro_vp8_dec_init()
186 ctx->vp8_dec.segment_map.cpu, in hantro_vp8_dec_init()
187 ctx->vp8_dec.segment_map.dma); in hantro_vp8_dec_init()
194 struct hantro_vp8_dec_hw_ctx *vp8_dec = &ctx->vp8_dec; in hantro_vp8_dec_exit()
195 struct hantro_dev *vpu = ctx->dev; in hantro_vp8_dec_exit()
197 dma_free_coherent(vpu->dev, vp8_dec->segment_map.size, in hantro_vp8_dec_exit()
198 vp8_dec->segment_map.cpu, vp8_dec->segment_map.dma); in hantro_vp8_dec_exit()
199 dma_free_coherent(vpu->dev, vp8_dec->prob_tbl.size, in hantro_vp8_dec_exit()
200 vp8_dec->prob_tbl.cpu, vp8_dec->prob_tbl.dma); in hantro_vp8_dec_exit()