| 423 | } |
| 424 | |
| 425 | static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, |
| 426 | const AVFrame *frame, int *got_packet) |
| 427 | { |
| 428 | CFHDEncContext *s = avctx->priv_data; |
| 429 | CFHDEncDSPContext *dsp = &s->dsp; |
| 430 | PutByteContext *pby = &s->pby; |
| 431 | PutBitContext *pb = &s->pb; |
| 432 | const Codebook *const cb = s->cb; |
| 433 | const Runbook *const rb = s->rb; |
| 434 | const uint16_t *lut = s->lut; |
| 435 | unsigned pos; |
| 436 | int ret; |
| 437 | |
| 438 | for (int plane = 0; plane < s->planes; plane++) { |
| 439 | const int h_shift = plane ? s->chroma_h_shift : 0; |
| 440 | int width = s->plane[plane].band[2][0].width; |
| 441 | int a_width = s->plane[plane].band[2][0].a_width; |
| 442 | int height = s->plane[plane].band[2][0].height; |
| 443 | int act_plane = plane == 1 ? 2 : plane == 2 ? 1 : plane; |
| 444 | const int16_t *input = (int16_t *)frame->data[act_plane]; |
| 445 | int16_t *buf; |
| 446 | int16_t *low = s->plane[plane].l_h[6]; |
| 447 | int16_t *high = s->plane[plane].l_h[7]; |
| 448 | ptrdiff_t in_stride = frame->linesize[act_plane] / 2; |
| 449 | int low_stride, high_stride; |
| 450 | |
| 451 | if (plane == 3) { |
| 452 | process_alpha(input, avctx->width, avctx->height, |
| 453 | in_stride, s->alpha); |
| 454 | input = s->alpha; |
| 455 | in_stride = avctx->width; |
| 456 | } |
| 457 | |
| 458 | dsp->horiz_filter(input, low, high, |
| 459 | in_stride, a_width, a_width, |
| 460 | avctx->width >> h_shift, avctx->height); |
| 461 | |
| 462 | input = s->plane[plane].l_h[7]; |
| 463 | low = s->plane[plane].subband[7]; |
| 464 | low_stride = s->plane[plane].band[2][0].a_width; |
| 465 | high = s->plane[plane].subband[9]; |
| 466 | high_stride = s->plane[plane].band[2][0].a_width; |
| 467 | |
| 468 | dsp->vert_filter(input, low, high, |
| 469 | a_width, low_stride, high_stride, |
| 470 | width, height * 2); |
| 471 | |
| 472 | input = s->plane[plane].l_h[6]; |
| 473 | low = s->plane[plane].l_h[7]; |
| 474 | high = s->plane[plane].subband[8]; |
| 475 | |
| 476 | dsp->vert_filter(input, low, high, |
| 477 | a_width, low_stride, high_stride, |
| 478 | width, height * 2); |
| 479 | |
| 480 | a_width = s->plane[plane].band[1][0].a_width; |
| 481 | width = s->plane[plane].band[1][0].width; |
| 482 | height = s->plane[plane].band[1][0].height; |
nothing calls this directly
no test coverage detected