[FFmpeg-devel] lavfi/buffersrc: Add AVBufferSrcParameters->bits_per_raw_sample parameter.

Submitted by Carl Eugen Hoyos on Nov. 17, 2017, 11:11 a.m.

Details

Message ID CAB0OVGoUUX91ARVz03=kgiJt2dxW86tTyvvW5gyJM9zuvh8w-Q@mail.gmail.com
State New
Headers show

Commit Message

Carl Eugen Hoyos Nov. 17, 2017, 11:11 a.m.
Hi!

I believe attached patch is necessary to fix ticket #6839 and several
older bug reports.

Missing version bump and APIchanges entry.

Please review, Carl Eugen

Comments

Paul B Mahol Nov. 17, 2017, 11:43 a.m.
On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> Hi!
>
> I believe attached patch is necessary to fix ticket #6839 and several
> older bug reports.

No it is not neccessary. Because nothing uses it.

>
> Missing version bump and APIchanges entry.
>
> Please review, Carl Eugen
>
Carl Eugen Hoyos Nov. 17, 2017, 12:26 p.m.
2017-11-17 12:43 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>> Hi!
>>
>> I believe attached patch is necessary to fix ticket #6839 and several
>> older bug reports.
>
> No it is not neccessary. Because nothing uses it.

libavcodec uses it in several codecs and others may benefit from it.
It is also used by ffmpeg and shown by ffprobe.

Carl Eugen
Paul B Mahol Nov. 17, 2017, 12:35 p.m.
On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2017-11-17 12:43 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>>> Hi!
>>>
>>> I believe attached patch is necessary to fix ticket #6839 and several
>>> older bug reports.
>>
>> No it is not neccessary. Because nothing uses it.
>
> libavcodec uses it in several codecs and others may benefit from it.
> It is also used by ffmpeg and shown by ffprobe.

But one you just added is not used....
Carl Eugen Hoyos Nov. 17, 2017, 12:48 p.m.
2017-11-17 13:35 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>> 2017-11-17 12:43 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>>> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

>>>> I believe attached patch is necessary to fix ticket #6839 and
>>>> several older bug reports.
>>>
>>> No it is not neccessary. Because nothing uses it.
>>
>> libavcodec uses it in several codecs and others may benefit from it.
>> It is also used by ffmpeg and shown by ffprobe.
>
> But one you just added is not used....

That is because I wanted to know if the addition of the field is
acceptable before patching the various functions that will use it.
Do you find that this is unreasonable?

But I realize now that the struct I had been searching for
is probably AVFilterLink in avfilter.h.

Sorry for the noise, Carl Eugen
Hendrik Leppkes Nov. 17, 2017, 3:40 p.m.
On Fri, Nov 17, 2017 at 1:26 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2017-11-17 12:43 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>>> Hi!
>>>
>>> I believe attached patch is necessary to fix ticket #6839 and several
>>> older bug reports.
>>
>> No it is not neccessary. Because nothing uses it.
>
> libavcodec uses it in several codecs and others may benefit from it.
> It is also used by ffmpeg and shown by ffprobe.
>

Where is this field realistically used for video? I only know if its
use for audio.

- Hendrik
Nicolas George Nov. 17, 2017, 6:26 p.m.
Le septidi 27 brumaire, an CCXXVI, Carl Eugen Hoyos a écrit :
> Hi!
> 
> I believe attached patch is necessary to fix ticket #6839 and several
> older bug reports.
> 
> Missing version bump and APIchanges entry.
> 
> Please review, Carl Eugen

As is, no, it is just code connected with nothing. With a full patch
maybe.

But if I understand correctly what this field does, then to get it
working you would have to go over all filters that change the contents
of the signal to see how many significant bits they produce.

Regards,
Paul B Mahol Nov. 17, 2017, 9:12 p.m.
On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> 2017-11-17 13:35 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>>> 2017-11-17 12:43 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
>>>> On 11/17/17, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
>>>>> I believe attached patch is necessary to fix ticket #6839 and
>>>>> several older bug reports.
>>>>
>>>> No it is not neccessary. Because nothing uses it.
>>>
>>> libavcodec uses it in several codecs and others may benefit from it.
>>> It is also used by ffmpeg and shown by ffprobe.
>>
>> But one you just added is not used....
>
> That is because I wanted to know if the addition of the field is
> acceptable before patching the various functions that will use it.
> Do you find that this is unreasonable?
>
> But I realize now that the struct I had been searching for
> is probably AVFilterLink in avfilter.h.
>
> Sorry for the noise, Carl Eugen

Proper way to fx that issue is change decoder to output gbrp10.

Patch hide | download patch | download mbox

From 3c5966f992c4bf5e64cc1a4196eb90f804b65bf6 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Fri, 17 Nov 2017 12:06:24 +0100
Subject: [PATCH] lavfi/buffersrc: Add
 AVBufferSrcParameters->bits_per_raw_sample parameter.

Allows to choose the correct destination pix_fmt for source pix_fmt
with bits_per_raw_sample < AVComponentDescriptor->depth.
---
 libavfilter/buffersrc.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
index 0652113..c9cb1a8 100644
--- a/libavfilter/buffersrc.h
+++ b/libavfilter/buffersrc.h
@@ -114,6 +114,13 @@  typedef struct AVBufferSrcParameters {
      * Audio only, the audio channel layout
      */
     uint64_t channel_layout;
+
+    /**
+     * Video only, the actual number of used bits of the AVPixelFormat,
+     * corresponds to bits_per_raw_sample.
+     * 0 means unknown, assume max number of bits for the AVPixelFormat.
+     */
+    int bits_per_raw_sample;
 } AVBufferSrcParameters;
 
 /**
-- 
1.7.10.4