MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / cfhd_encode_frame

Function cfhd_encode_frame

libavcodec/cfhdenc.c:425–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425static 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;

Callers

nothing calls this directly

Calls 14

ff_alloc_packetFunction · 0.85
bytestream2_init_writerFunction · 0.85
bytestream2_tell_pFunction · 0.85
quantize_bandFunction · 0.85
init_put_bitsFunction · 0.85
put_runcodeFunction · 0.85
flush_put_bitsFunction · 0.85
bytestream2_skip_pFunction · 0.85
put_bytes_outputFunction · 0.85
av_shrink_packetFunction · 0.85
bytestream2_seek_pFunction · 0.85

Tested by

no test coverage detected