[vlc-devel] [PATCH] aom: encoder: add tile-rows and tile-columns options

Zhao Zhili quinkblack at foxmail.com
Wed Sep 19 08:24:47 CEST 2018



On 2018年09月19日 12:07, Tristan Matthews wrote:
> ---
>   modules/codec/aom.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/modules/codec/aom.c b/modules/codec/aom.c
> index 63fb356e19..88d5fd5aef 100644
> --- a/modules/codec/aom.c
> +++ b/modules/codec/aom.c
> @@ -80,6 +80,10 @@ vlc_module_begin ()
>               change_integer_range( 0, 3 )
>           add_integer( SOUT_CFG_PREFIX "bitdepth", 8, "Bit Depth", NULL, true )
>               change_integer_list( pi_enc_bitdepth_values_list, ppsz_enc_bitdepth_text )
> +        add_integer( SOUT_CFG_PREFIX "tile-rows", 0, "Tile Rows (in log2 units)", NULL, true )
> +            change_integer_range( 0, 6 ) /* 1 << 6 == MAX_TILE_ROWS */
> +        add_integer( SOUT_CFG_PREFIX "tile-columns", 0, "Tile Columns (in log2 units)", NULL, true )
> +            change_integer_range( 0, 6 ) /* 1 << 6 == MAX_TILE_COLS */
>   #endif
>   vlc_module_end ()
>   
> @@ -415,6 +419,8 @@ static int OpenEncoder(vlc_object_t *p_this)
>       int enc_flags;
>       int i_profile = var_InheritInteger( p_enc, SOUT_CFG_PREFIX "profile" );
>       int i_bit_depth = var_InheritInteger( p_enc, SOUT_CFG_PREFIX "bitdepth" );
> +    int i_tile_rows = var_InheritInteger( p_enc, SOUT_CFG_PREFIX "tile-rows" );
> +    int i_tile_columns = var_InheritInteger( p_enc, SOUT_CFG_PREFIX "tile-columns" );
>   
>       /* TODO: implement higher profiles, bit depths and other pixformats. */
>       switch( i_profile )
> @@ -463,6 +469,22 @@ static int OpenEncoder(vlc_object_t *p_this)
>           return VLC_EGENERIC;
>       }
>   
> +    if (i_tile_rows >= 0 &&
> +        aom_codec_control(ctx, AV1E_SET_TILE_ROWS, i_tile_rows))
> +    {
> +        AOM_ERR(p_this, ctx, "Failed to set tile rows");
> +        free(p_sys);
> +        return VLC_EGENERIC;
Should the ctx be destroyed in this case?

> +    }
> +
> +    if (i_tile_columns >= 0 &&
> +        aom_codec_control(ctx, AV1E_SET_TILE_COLUMNS, i_tile_columns))
> +    {
> +        AOM_ERR(p_this, ctx, "Failed to set tile columns");
> +        free(p_sys);
> +        return VLC_EGENERIC;
Ditto.

> +    }
> +
>       p_enc->pf_encode_video = Encode;
>   
>       return VLC_SUCCESS;



More information about the vlc-devel mailing list