[FFmpeg-devel] [PATCH 2/3] lavc: Add coded bitstream read/write support for AV1

James Almer jamrial at gmail.com
Tue Sep 11 16:15:46 EEST 2018


On 9/9/2018 7:08 PM, Mark Thompson wrote:
> +static void cbs_av1_free_obu(void *unit, uint8_t *content)
> +{
> +    AV1RawOBU *obu = (AV1RawOBU*)content;
> +
> +    switch (obu->header.obu_type) {
> +    case AV1_OBU_TILE_GROUP:
> +        cbs_av1_free_tile_data(&obu->tile_group.tile_data);
> +        break;
> +    case AV1_OBU_FRAME:
> +        cbs_av1_free_tile_data(&obu->frame.tile_group.tile_data);
> +        break;
> +    case AV1_OBU_TILE_LIST:
> +        cbs_av1_free_tile_data(&obu->tile_list.tile_data);
> +        break;
> +    case AV1_OBU_METADATA:
> +        cbs_av1_free_metadata(&obu->metadata);
> +        break;
> +    }
> +
> +    av_freep(&obu);

Why adding a custom free function for all OBUs when only four types need
it? Sounds like unnecessary overhead for all cases.
IMO what cbs_h2645 does is better, using the default free function where
a custom one isn't needed, then calling a custom free function directly
for those that need one.


More information about the ffmpeg-devel mailing list