[FFmpeg-devel] [PATCH 3/4] avdevice/decklink_dec: Added Closed caption decode from VANC
James Almer
jamrial at gmail.com
Fri Sep 29 05:00:47 EEST 2017
On 9/28/2017 1:17 AM, Jeyapal, Karthick wrote:
>> Sorry, still not quite there... Here are some further comments:
> Thanks for your comments and patience. Please find the updated patch attached, with all the comments taken.
> Also, I have rebased this patch with the latest ffmpeg, as avcodec version numbers have changed in the meantime.
>
>> Also please test your patches with real CC data before posting them, I
>> know it is tedious work with all the patch iterations, but I do the same
>> with teletext.
> Sorry about that. I did test that patch with real CC data and corrected the inverted checks, but I forgot and attached the older patch in a hurry.
> Sorry for wasting your time there.
>
>> Fingers crossed for the next patch version :)
> Well, me too :)
>
> Thanks and Regards,
> Karthick
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 39d9ad9..7aee6f9 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -29,7 +29,7 @@
>
> #define LIBAVCODEC_VERSION_MAJOR 57
> #define LIBAVCODEC_VERSION_MINOR 106
> -#define LIBAVCODEC_VERSION_MICRO 103
> +#define LIBAVCODEC_VERSION_MICRO 104
>
> #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> LIBAVCODEC_VERSION_MINOR, \
> diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
> index 38e6bd8..3c283e0 100644
> --- a/libavdevice/decklink_dec.cpp
> +++ b/libavdevice/decklink_dec.cpp
> @@ -1,6 +1,7 @@
> /*
> * Blackmagic DeckLink input
> * Copyright (c) 2013-2014 Luca Barbato, Deti Fliegl
> + * Copyright (c) 2014 Rafaël Carré
> * Copyright (c) 2017 Akamai Technologies, Inc.
> *
> * This file is part of FFmpeg.
> @@ -105,6 +106,42 @@ static int get_vanc_line_idx(BMDDisplayMode mode)
> return i - 1;
> }
>
> +static inline uint16_t parity (uint16_t x)
> +{
> + uint16_t i;
> + for (i = 4 * sizeof (x); i > 0; i /= 2)
> + x ^= x >> i;
> + return x & 1;
> +}
Can't you use av_parity() instead?
More information about the ffmpeg-devel
mailing list