diff mbox

[FFmpeg-devel,libdav1d.c] : Add options for spatial layers.

Message ID 20191114173605.3595-1-tfoucu@gmail.com
State Superseded
Headers show

Commit Message

Thierry Foucu Nov. 14, 2019, 5:36 p.m. UTC
Disable by default to output all the layers, to match libaomdec wrapper.
Add option to select the operating point for the spatial layers.
---
 libavcodec/libdav1d.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thierry Foucu Nov. 20, 2019, 5:55 p.m. UTC | #1
On Thu, Nov 14, 2019 at 9:36 AM Thierry Foucu <tfoucu@gmail.com> wrote:

> Disable by default to output all the layers, to match libaomdec wrapper.
> Add option to select the operating point for the spatial layers.
> ---
>  libavcodec/libdav1d.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
> index cf4b178f1d..ea4ef641bf 100644
> --- a/libavcodec/libdav1d.c
> +++ b/libavcodec/libdav1d.c
> @@ -40,6 +40,8 @@ typedef struct Libdav1dContext {
>      int tile_threads;
>      int frame_threads;
>      int apply_grain;
> +    int operating_point;
> +    int all_layers;
>  } Libdav1dContext;
>
>  static const enum AVPixelFormat pix_fmt[][3] = {
> @@ -134,6 +136,10 @@ static av_cold int libdav1d_init(AVCodecContext *c)
>      if (dav1d->apply_grain >= 0)
>          s.apply_grain = dav1d->apply_grain;
>
> +    s.all_layers = dav1d->all_layers;
> +    if (dav1d->operating_point >= 0)
> +        s.operating_point = dav1d->operating_point;
> +
>      s.n_tile_threads = dav1d->tile_threads
>                       ? dav1d->tile_threads
>                       : FFMIN(floor(sqrt(threads)),
> DAV1D_MAX_TILE_THREADS);
> @@ -378,6 +384,8 @@ static const AVOption libdav1d_options[] = {
>      { "tilethreads", "Tile threads", OFFSET(tile_threads),
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
>      { "framethreads", "Frame threads", OFFSET(frame_threads),
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
>      { "filmgrain", "Apply Film Grain", OFFSET(apply_grain),
> AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
> +    { "oppoint",  "Select an operating point of the scalable bitstream",
> OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, 31, VD },
> +    { "alllayers", "Output all spatial layers", OFFSET(all_layers),
> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>      { NULL }
>  };
>
> --
> 2.24.0.432.g9d3f5f5b63-goog
>
>
ping?

Is this patch ok?
Thierry Foucu Nov. 25, 2019, 11:16 p.m. UTC | #2
On Wed, Nov 20, 2019 at 9:55 AM Thierry Foucu <tfoucu@gmail.com> wrote:

>
>
> On Thu, Nov 14, 2019 at 9:36 AM Thierry Foucu <tfoucu@gmail.com> wrote:
>
>> Disable by default to output all the layers, to match libaomdec wrapper.
>> Add option to select the operating point for the spatial layers.
>> ---
>>  libavcodec/libdav1d.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
>> index cf4b178f1d..ea4ef641bf 100644
>> --- a/libavcodec/libdav1d.c
>> +++ b/libavcodec/libdav1d.c
>> @@ -40,6 +40,8 @@ typedef struct Libdav1dContext {
>>      int tile_threads;
>>      int frame_threads;
>>      int apply_grain;
>> +    int operating_point;
>> +    int all_layers;
>>  } Libdav1dContext;
>>
>>  static const enum AVPixelFormat pix_fmt[][3] = {
>> @@ -134,6 +136,10 @@ static av_cold int libdav1d_init(AVCodecContext *c)
>>      if (dav1d->apply_grain >= 0)
>>          s.apply_grain = dav1d->apply_grain;
>>
>> +    s.all_layers = dav1d->all_layers;
>> +    if (dav1d->operating_point >= 0)
>> +        s.operating_point = dav1d->operating_point;
>> +
>>      s.n_tile_threads = dav1d->tile_threads
>>                       ? dav1d->tile_threads
>>                       : FFMIN(floor(sqrt(threads)),
>> DAV1D_MAX_TILE_THREADS);
>> @@ -378,6 +384,8 @@ static const AVOption libdav1d_options[] = {
>>      { "tilethreads", "Tile threads", OFFSET(tile_threads),
>> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
>>      { "framethreads", "Frame threads", OFFSET(frame_threads),
>> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
>>      { "filmgrain", "Apply Film Grain", OFFSET(apply_grain),
>> AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
>> +    { "oppoint",  "Select an operating point of the scalable bitstream",
>> OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, 31, VD },
>> +    { "alllayers", "Output all spatial layers", OFFSET(all_layers),
>> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>>      { NULL }
>>  };
>>
>> --
>> 2.24.0.432.g9d3f5f5b63-goog
>>
>>
> ping?
>
> Is this patch ok?
>


Any chance to be submitted? or is there any more comment on it?


>
>
Steven Liu Nov. 26, 2019, 2:51 a.m. UTC | #3
> 在 2019年11月26日,07:16,Thierry Foucu <tfoucu@gmail.com> 写道:
> 
> On Wed, Nov 20, 2019 at 9:55 AM Thierry Foucu <tfoucu@gmail.com> wrote:
> 
>> 
>> 
>> On Thu, Nov 14, 2019 at 9:36 AM Thierry Foucu <tfoucu@gmail.com> wrote:
>> 
>>> Disable by default to output all the layers, to match libaomdec wrapper.
>>> Add option to select the operating point for the spatial layers.
>>> ---
>>> libavcodec/libdav1d.c | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>> 
>>> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
>>> index cf4b178f1d..ea4ef641bf 100644
>>> --- a/libavcodec/libdav1d.c
>>> +++ b/libavcodec/libdav1d.c
>>> @@ -40,6 +40,8 @@ typedef struct Libdav1dContext {
>>>     int tile_threads;
>>>     int frame_threads;
>>>     int apply_grain;
>>> +    int operating_point;
>>> +    int all_layers;
>>> } Libdav1dContext;
>>> 
>>> static const enum AVPixelFormat pix_fmt[][3] = {
>>> @@ -134,6 +136,10 @@ static av_cold int libdav1d_init(AVCodecContext *c)
>>>     if (dav1d->apply_grain >= 0)
>>>         s.apply_grain = dav1d->apply_grain;
>>> 
>>> +    s.all_layers = dav1d->all_layers;
>>> +    if (dav1d->operating_point >= 0)
>>> +        s.operating_point = dav1d->operating_point;
>>> +
>>>     s.n_tile_threads = dav1d->tile_threads
>>>                      ? dav1d->tile_threads
>>>                      : FFMIN(floor(sqrt(threads)),
>>> DAV1D_MAX_TILE_THREADS);
>>> @@ -378,6 +384,8 @@ static const AVOption libdav1d_options[] = {
>>>     { "tilethreads", "Tile threads", OFFSET(tile_threads),
>>> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
>>>     { "framethreads", "Frame threads", OFFSET(frame_threads),
>>> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
>>>     { "filmgrain", "Apply Film Grain", OFFSET(apply_grain),
>>> AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
>>> +    { "oppoint",  "Select an operating point of the scalable bitstream",
>>> OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, 31, VD },
>>> +    { "alllayers", "Output all spatial layers", OFFSET(all_layers),
>>> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>>>     { NULL }
>>> };
>>> 
>>> --
>>> 2.24.0.432.g9d3f5f5b63-goog
>>> 
>>> 
>> ping?
>> 
>> Is this patch ok?
>> 
> 
> 
> Any chance to be submitted? or is there any more comment on it?
LGTM, But i think there maybe need one document to describe these two options.
> 
> 
>> 
>> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Thanks
Steven
diff mbox

Patch

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index cf4b178f1d..ea4ef641bf 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -40,6 +40,8 @@  typedef struct Libdav1dContext {
     int tile_threads;
     int frame_threads;
     int apply_grain;
+    int operating_point;
+    int all_layers;
 } Libdav1dContext;
 
 static const enum AVPixelFormat pix_fmt[][3] = {
@@ -134,6 +136,10 @@  static av_cold int libdav1d_init(AVCodecContext *c)
     if (dav1d->apply_grain >= 0)
         s.apply_grain = dav1d->apply_grain;
 
+    s.all_layers = dav1d->all_layers;
+    if (dav1d->operating_point >= 0)
+        s.operating_point = dav1d->operating_point;
+
     s.n_tile_threads = dav1d->tile_threads
                      ? dav1d->tile_threads
                      : FFMIN(floor(sqrt(threads)), DAV1D_MAX_TILE_THREADS);
@@ -378,6 +384,8 @@  static const AVOption libdav1d_options[] = {
     { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
     { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
     { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
+    { "oppoint",  "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, 31, VD },
+    { "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
     { NULL }
 };