[FFmpeg-devel] [PATCH V4] avcodec/libvpxenc: add VP8 support for ROI-based encoding

James Zern jzern at google.com
Wed Mar 13 01:44:41 EET 2019


On Fri, Mar 8, 2019 at 5:07 AM Guo, Yejun <yejun.guo at intel.com> wrote:
>
> Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
> ---
>  libavcodec/libvpxenc.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 150 insertions(+)
>
> [...]
> +    active_map.active_map = av_malloc(active_map.rows * active_map.cols);
> +    if (!active_map.active_map) {
> +        av_log(avctx, AV_LOG_ERROR, "active_map alloc failed.\n");
> +        ret = AVERROR(ENOMEM);
> +        goto fail;
> +    }
> +    /* set 1 to enable the corresponding element of vpx_roi_map_t.roi_map. */
> +    memset(active_map.active_map, 1, active_map.rows * active_map.cols);
>

ROI is independent of active map, you don't need it for ROI to work.
In this case you're setting the entire frame as active which may not
be what you want. For this patch maybe we should focus on only setting
the ROI.


More information about the ffmpeg-devel mailing list