| 613 | } |
| 614 | |
| 615 | static void flush(hb_work_object_t *w, hb_buffer_t *in, hb_buffer_list_t *list) |
| 616 | { |
| 617 | hb_work_private_t *pv = w->private_data; |
| 618 | hb_job_t *job = pv->job; |
| 619 | hb_interjob_t *interjob = hb_interjob_get(job->h); |
| 620 | |
| 621 | send(w, in); |
| 622 | |
| 623 | hb_buffer_t *out = NULL; |
| 624 | while (receive(w, &out, 1) == 0) |
| 625 | { |
| 626 | hb_buffer_list_append(list, out); |
| 627 | } |
| 628 | |
| 629 | // Store the first pass stats for the next |
| 630 | if (job->pass_id == HB_PASS_ENCODE_ANALYSIS && interjob->context == NULL) |
| 631 | { |
| 632 | SvtAv1FixedBuf first_pass_stat; |
| 633 | EbErrorType ret = svt_av1_enc_get_stream_info(pv->svt_handle, |
| 634 | SVT_AV1_STREAM_INFO_FIRST_PASS_STATS_OUT, |
| 635 | &first_pass_stat); |
| 636 | if (ret == EB_ErrorNone) |
| 637 | { |
| 638 | interjob->context = av_malloc(first_pass_stat.sz); |
| 639 | if (interjob->context) |
| 640 | { |
| 641 | memcpy(interjob->context, first_pass_stat.buf, first_pass_stat.sz); |
| 642 | interjob->context_size = first_pass_stat.sz; |
| 643 | } |
| 644 | } |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | int encsvtWork(hb_work_object_t *w, hb_buffer_t **buf_in, |
| 649 | hb_buffer_t **buf_out) |
no test coverage detected