[FFmpeg-devel] avcodec: Add more kCVImageBufferColorPrimaries to videotoolboxenc

Submitted by Nomis101 on Nov. 3, 2019, 12:20 a.m.

Details

Message ID 20191103002038.95254-1-Nomis101@web.de
State New
Headers show

Commit Message

Nomis101 Nov. 3, 2019, 12:20 a.m.
---
 libavcodec/videotoolboxenc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

--
2.21.0 (Apple Git-122)

Comments

Nomis101 Nov. 12, 2019, 11:27 a.m.
Videotoolbox currently only supports the color primaries gamut ITU R 709 and 2020. This patch adds support for EBU 3213 (PAL video) and SMPTE C (standard definition video). That is importand for video
convertion applications, based on FFmpeg. Would be nice to get this reviewed.


Am 03.11.19 um 01:20 schrieb Nomis101:
> ---
>  libavcodec/videotoolboxenc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 40a7f643e0..cc08cf6a50 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext *avctx,
>              *primaries = NULL;
>              break;
>
> +        case AVCOL_PRI_BT470BG:
> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
> +            break;
> +
> +        case AVCOL_PRI_SMPTE170M:
> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
> +            break;
> +
>          case AVCOL_PRI_BT709:
>              *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
>              break;
> --
> 2.21.0 (Apple Git-122)
>
lance.lmwang@gmail.com Nov. 15, 2019, 2:58 p.m.
On Sun, Nov 03, 2019 at 01:20:38AM +0100, Nomis101 wrote:
> ---
>  libavcodec/videotoolboxenc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 40a7f643e0..cc08cf6a50 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext *avctx,
>              *primaries = NULL;
>              break;
> 
> +        case AVCOL_PRI_BT470BG:
> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
> +            break;
> +
> +        case AVCOL_PRI_SMPTE170M:
> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
> +            break;
> +

lgtm

>          case AVCOL_PRI_BT709:
>              *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
>              break;
> --
> 2.21.0 (Apple Git-122)
> 
> _______________________________________________
> 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".
Nomis101 Nov. 17, 2019, 12:02 a.m.
Thanks for reviewing. Would be nice, if somebody could push to master then. I can't.



Am 15.11.19 um 15:58 schrieb Limin Wang:
> On Sun, Nov 03, 2019 at 01:20:38AM +0100, Nomis101 wrote:
>> ---
>>  libavcodec/videotoolboxenc.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>> index 40a7f643e0..cc08cf6a50 100644
>> --- a/libavcodec/videotoolboxenc.c
>> +++ b/libavcodec/videotoolboxenc.c
>> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext *avctx,
>>              *primaries = NULL;
>>              break;
>>
>> +        case AVCOL_PRI_BT470BG:
>> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
>> +            break;
>> +
>> +        case AVCOL_PRI_SMPTE170M:
>> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
>> +            break;
>> +
> lgtm
>
>>          case AVCOL_PRI_BT709:
>>              *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
>>              break;
>> --
>> 2.21.0 (Apple Git-122)
>>
>> _______________________________________________
>> 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".
> _______________________________________________
> 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".
Richard Kern Nov. 17, 2019, 12:05 a.m.
> On Nov 16, 2019, at 7:03 PM, Nomis101 <Nomis101@web.de> wrote:
> 
> Thanks for reviewing. Would be nice, if somebody could push to master then. I can't.
> 
> 
I’ll test it out tomorrow and push. 

> 
>> Am 15.11.19 um 15:58 schrieb Limin Wang:
>>> On Sun, Nov 03, 2019 at 01:20:38AM +0100, Nomis101 wrote:
>>> ---
>>> libavcodec/videotoolboxenc.c | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>> 
>>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>>> index 40a7f643e0..cc08cf6a50 100644
>>> --- a/libavcodec/videotoolboxenc.c
>>> +++ b/libavcodec/videotoolboxenc.c
>>> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext *avctx,
>>>             *primaries = NULL;
>>>             break;
>>> 
>>> +        case AVCOL_PRI_BT470BG:
>>> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
>>> +            break;
>>> +
>>> +        case AVCOL_PRI_SMPTE170M:
>>> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
>>> +            break;
>>> +
>> lgtm
>> 
>>>         case AVCOL_PRI_BT709:
>>>             *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
>>>             break;
>>> --
>>> 2.21.0 (Apple Git-122)
>>> 
>>> _______________________________________________
>>> 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".
>> _______________________________________________
>> 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".
> 
> _______________________________________________
> 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".
Nomis101 Nov. 17, 2019, 3:25 p.m.
Am 17.11.19 um 01:05 schrieb Richard Kern:
>
>> On Nov 16, 2019, at 7:03 PM, Nomis101 <Nomis101@web.de> wrote:
>>
>> Thanks for reviewing. Would be nice, if somebody could push to master then. I can't.
>>
>>
> I’ll test it out tomorrow and push. 

Cool, thank you very much. :-)

>
>>> Am 15.11.19 um 15:58 schrieb Limin Wang:
>>>> On Sun, Nov 03, 2019 at 01:20:38AM +0100, Nomis101 wrote:
>>>> ---
>>>> libavcodec/videotoolboxenc.c | 8 ++++++++
>>>> 1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>>>> index 40a7f643e0..cc08cf6a50 100644
>>>> --- a/libavcodec/videotoolboxenc.c
>>>> +++ b/libavcodec/videotoolboxenc.c
>>>> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext *avctx,
>>>>             *primaries = NULL;
>>>>             break;
>>>>
>>>> +        case AVCOL_PRI_BT470BG:
>>>> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
>>>> +            break;
>>>> +
>>>> +        case AVCOL_PRI_SMPTE170M:
>>>> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
>>>> +            break;
>>>> +
>>> lgtm
>>>
>>>>         case AVCOL_PRI_BT709:
>>>>             *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
>>>>             break;
>>>> --
>>>> 2.21.0 (Apple Git-122)
>>>>
>>>> _______________________________________________
>>>> 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".
>>> _______________________________________________
>>> 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".
>> _______________________________________________
>> 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".
> _______________________________________________
> 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".
Richard Kern Nov. 17, 2019, 9:32 p.m.
On Sun, Nov 17, 2019 at 10:25 AM Nomis101 <Nomis101@web.de> wrote:

> Am 17.11.19 um 01:05 schrieb Richard Kern:
> >
> >> On Nov 16, 2019, at 7:03 PM, Nomis101 <Nomis101@web.de> wrote:
> >>
> >> Thanks for reviewing. Would be nice, if somebody could push to master
> then. I can't.
> >>
> >>
> > I’ll test it out tomorrow and push.
>
> Cool, thank you very much. :-)
>
Thanks, pushed.


>
> >
> >>> Am 15.11.19 um 15:58 schrieb Limin Wang:
> >>>> On Sun, Nov 03, 2019 at 01:20:38AM +0100, Nomis101 wrote:
> >>>> ---
> >>>> libavcodec/videotoolboxenc.c | 8 ++++++++
> >>>> 1 file changed, 8 insertions(+)
> >>>>
> >>>> diff --git a/libavcodec/videotoolboxenc.c
> b/libavcodec/videotoolboxenc.c
> >>>> index 40a7f643e0..cc08cf6a50 100644
> >>>> --- a/libavcodec/videotoolboxenc.c
> >>>> +++ b/libavcodec/videotoolboxenc.c
> >>>> @@ -894,6 +894,14 @@ static int get_cv_color_primaries(AVCodecContext
> *avctx,
> >>>>             *primaries = NULL;
> >>>>             break;
> >>>>
> >>>> +        case AVCOL_PRI_BT470BG:
> >>>> +            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
> >>>> +            break;
> >>>> +
> >>>> +        case AVCOL_PRI_SMPTE170M:
> >>>> +            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
> >>>> +            break;
> >>>> +
> >>> lgtm
> >>>
> >>>>         case AVCOL_PRI_BT709:
> >>>>             *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
> >>>>             break;
> >>>> --
> >>>> 2.21.0 (Apple Git-122)
> >>>>
> >>>> _______________________________________________
> >>>> 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".
> >>> _______________________________________________
> >>> 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".
> >> _______________________________________________
> >> 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".
> > _______________________________________________
> > 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".
>
>
> _______________________________________________
> 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".

Patch hide | download patch | download mbox

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 40a7f643e0..cc08cf6a50 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -894,6 +894,14 @@  static int get_cv_color_primaries(AVCodecContext *avctx,
             *primaries = NULL;
             break;

+        case AVCOL_PRI_BT470BG:
+            *primaries = kCVImageBufferColorPrimaries_EBU_3213;
+            break;
+
+        case AVCOL_PRI_SMPTE170M:
+            *primaries = kCVImageBufferColorPrimaries_SMPTE_C;
+            break;
+
         case AVCOL_PRI_BT709:
             *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2;
             break;