[1/3] libavcodec: Make the slice_count option settable for video encoders

Message ID 1420039277-53673-1-git-send-email-martin@martin.st
State Deferred
Headers show

Commit Message

Martin Storsjö Dec. 31, 2014, 3:21 p.m.
---
 libavcodec/options_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Dec. 31, 2014, 3:48 p.m. | #1
On 31/12/14 16:21, Martin Storsjö wrote:
> ---
>   libavcodec/options_table.h | 2 +-

Ok.
Derek Buitenhuis Dec. 31, 2014, 5:03 p.m. | #2
On 12/31/2014 3:21 PM, Martin Storsjö wrote:
> ---
>  libavcodec/options_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Didn't we use avctx->slices before?

See: https://github.com/libav/libav/blob/master/libavcodec/utvideoenc.c#L137-146

- Derek
Martin Storsjö Dec. 31, 2014, 5:07 p.m. | #3
On Wed, 31 Dec 2014, Derek Buitenhuis wrote:

> On 12/31/2014 3:21 PM, Martin Storsjö wrote:
>> ---
>>  libavcodec/options_table.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Didn't we use avctx->slices before?
>
> See: https://github.com/libav/libav/blob/master/libavcodec/utvideoenc.c#L137-146

Oh, indeed. I'll change it to use that instead, and drop this patch. (Why 
do we have two separate fields for almost the same thing?)

// Martin
Derek Buitenhuis Dec. 31, 2014, 5:10 p.m. | #4
On 12/31/2014 5:07 PM, Martin Storsjö wrote:
> (Why do we have two separate fields for almost the same thing?)

I'm sure there's some silly historical reason.

- Derek
Luca Barbato Dec. 31, 2014, 5:25 p.m. | #5
On 31/12/14 18:10, Derek Buitenhuis wrote:
> On 12/31/2014 5:07 PM, Martin Storsjö wrote:
>> (Why do we have two separate fields for almost the same thing?)
>
> I'm sure there's some silly historical reason.
>

Shall we fix it?

lu
Derek Buitenhuis Dec. 31, 2014, 5:26 p.m. | #6
On 12/31/2014 5:25 PM, Luca Barbato wrote:
> Shall we fix it?

Should probably find out why first.

- Derek
Luca Barbato Dec. 31, 2014, 5:30 p.m. | #7
On 31/12/14 18:26, Derek Buitenhuis wrote:
> On 12/31/2014 5:25 PM, Luca Barbato wrote:
>> Shall we fix it?
>
> Should probably find out why first.
>

That's the start of fixing it =)

lu

Patch

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 91d7ff9..83bfb47 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -223,7 +223,7 @@  static const AVOption avcodec_options[] = {
 {"xvidmmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
 #endif /* FF_API_IDCT_XVIDMMX */
 {"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
-{"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+{"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, "ec"},
 {"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
 {"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"},