| 2244 | } |
| 2245 | |
| 2246 | static int decode_slice(AVCodecContext *avctx, void *tdata, int cu_y, int threadnr) |
| 2247 | { |
| 2248 | RV60Context *s = avctx->priv_data; |
| 2249 | AVFrame * frame = tdata; |
| 2250 | ThreadContext thread; |
| 2251 | GetBitContext gb; |
| 2252 | int qp, sel_qp, ret; |
| 2253 | |
| 2254 | thread.avg_data[0] = thread.avg_buffer; |
| 2255 | thread.avg_data[1] = thread.avg_buffer + 64*64; |
| 2256 | thread.avg_data[2] = thread.avg_buffer + 64*64 + 32*32; |
| 2257 | thread.avg_linesize[0] = 64; |
| 2258 | thread.avg_linesize[1] = 32; |
| 2259 | thread.avg_linesize[2] = 32; |
| 2260 | |
| 2261 | if ((ret = init_get_bits8(&gb, s->slice[cu_y].data, s->slice[cu_y].data_size)) < 0) |
| 2262 | return ret; |
| 2263 | |
| 2264 | for (int cu_x = 0; cu_x < s->cu_width; cu_x++) { |
| 2265 | if ((s->avctx->active_thread_type & FF_THREAD_SLICE) && cu_y) |
| 2266 | ff_thread_progress_await(&s->progress[cu_y - 1], cu_x + 2); |
| 2267 | |
| 2268 | qp = s->qp + read_qp_offset(&gb, s->qp_off_type); |
| 2269 | if (qp < 0 || qp >= 64) { |
| 2270 | ret = AVERROR_INVALIDDATA; |
| 2271 | break; |
| 2272 | } |
| 2273 | sel_qp = calc_sel_qp(s->osvquant, qp); |
| 2274 | |
| 2275 | memset(thread.coded_blk, 0, sizeof(thread.coded_blk)); |
| 2276 | thread.cu_split_pos = 0; |
| 2277 | |
| 2278 | if ((ret = decode_cu_r(s, frame, &thread, &gb, cu_x << 6, cu_y << 6, 6, qp, sel_qp)) < 0) |
| 2279 | break; |
| 2280 | |
| 2281 | if (s->deblock) { |
| 2282 | thread.cu_split_pos = 0; |
| 2283 | deblock_cu_r(s, frame, &thread, cu_x << 6, cu_y << 6, 6, qp); |
| 2284 | } |
| 2285 | |
| 2286 | if (s->avctx->active_thread_type & FF_THREAD_SLICE) |
| 2287 | ff_thread_progress_report(&s->progress[cu_y], cu_x + 1); |
| 2288 | } |
| 2289 | |
| 2290 | if (s->avctx->active_thread_type & FF_THREAD_SLICE) |
| 2291 | ff_thread_progress_report(&s->progress[cu_y], INT_MAX); |
| 2292 | |
| 2293 | return ret; |
| 2294 | } |
| 2295 | |
| 2296 | static int rv60_decode_frame(AVCodecContext *avctx, AVFrame * frame, |
| 2297 | int * got_frame, AVPacket * avpkt) |
nothing calls this directly
no test coverage detected