Lines Matching refs:cx_frame
195 static void coded_frame_add(void *list, struct FrameListData *cx_frame)
201 *p = cx_frame;
202 cx_frame->next = NULL;
205 static av_cold void free_coded_frame(struct FrameListData *cx_frame)
207 av_freep(&cx_frame->buf);
208 if (cx_frame->buf_alpha)
209 av_freep(&cx_frame->buf_alpha);
210 av_freep(&cx_frame);
508 * Write information from @a cx_frame to @a pkt
512 static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
515 int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz);
518 memcpy(pkt->data, cx_frame->buf, pkt->size);
519 pkt->pts = pkt->dts = cx_frame->pts;
520 coded_frame->pts = cx_frame->pts;
521 coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
529 if (cx_frame->have_sse) {
532 coded_frame->error[0] = cx_frame->sse[1];
533 coded_frame->error[1] = cx_frame->sse[2];
534 coded_frame->error[2] = cx_frame->sse[3];
539 cx_frame->have_sse = 0;
541 if (cx_frame->sz_alpha > 0) {
544 cx_frame->sz_alpha + 8);
551 memcpy(side_data + 8, cx_frame->buf_alpha, cx_frame->sz_alpha);
578 struct FrameListData *cx_frame = ctx->coded_frame_list;
580 size = storeframe(avctx, cx_frame, pkt_out, coded_frame);
583 ctx->coded_frame_list = cx_frame->next;
584 free_coded_frame(cx_frame);
595 struct FrameListData cx_frame;
600 cx_pktcpy(&cx_frame, pkt, pkt_alpha, ctx);
601 size = storeframe(avctx, &cx_frame, pkt_out, coded_frame);
605 struct FrameListData *cx_frame =
608 if (!cx_frame) {
613 cx_pktcpy(cx_frame, pkt, pkt_alpha, ctx);
614 cx_frame->buf = av_malloc(cx_frame->sz);
616 if (!cx_frame->buf) {
619 cx_frame->sz);
620 av_free(cx_frame);
623 memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);
625 cx_frame->buf_alpha = av_malloc(cx_frame->sz_alpha);
626 if (!cx_frame->buf_alpha) {
629 cx_frame->sz_alpha);
630 av_free(cx_frame);
633 memcpy(cx_frame->buf_alpha, pkt_alpha->data.frame.buf, pkt_alpha->data.frame.sz);
635 coded_frame_add(&ctx->coded_frame_list, cx_frame);