[FFmpeg-devel] Add mpeg user_data CEA-608/708 extraction.

Michael Niedermayer michaelni
Sun Apr 11 23:28:05 CEST 2010


On Sun, Apr 11, 2010 at 02:15:08PM -0400, Daniel Kristjansson wrote:
> 
> This patch pulls CEA-608 and 708 data from the user data and puts it
> in atsc_cc_buf buffer attached to each frame. The data passed in
> atsc_cc_buf is CEA-708-D caption packets for both data encoded using
> the ATSC user data and the SCTE-20 user data encodings. An example
> of how to decode this for display is present in MythTV, ccextract,
> etc.
> 
> -- Daniel
[...]
> Index: libavcodec/mpegvideo.h
> ===================================================================
> --- libavcodec/mpegvideo.h	(revision 22838)
> +++ libavcodec/mpegvideo.h	(working copy)
> @@ -645,6 +645,13 @@
>  
>      DCTELEM (*block)[64]; ///< points to one of the following blocks
>      DCTELEM (*blocks)[8][64]; // for HQ mode we need to keep the best block
> +
> +#define ATSC_CC_BUF_SIZE 1024
> +    /// Used to hold cached user_data about caption packets before the
> +    /// frame for these packets has been created in MPV_frame_start().
> +    uint8_t tmp_atsc_cc_buf[ATSC_CC_BUF_SIZE];
> +    int     tmp_atsc_cc_len;
> +
>      int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
>  #define SLICE_OK         0
>  #define SLICE_ERROR     -1

if its specific to mpeg1/2 then it doesnt belong in here, especially if its 1kb


[...]
>  
>  static void mpeg_decode_gop(AVCodecContext *avctx,
> Index: libavcodec/avcodec.h
> ===================================================================
> --- libavcodec/avcodec.h	(revision 22838)
> +++ libavcodec/avcodec.h	(working copy)
> @@ -923,6 +923,13 @@
>       * - decoding: Set by libavcodec\
>       */\
>      void *hwaccel_picture_private;\
> +\
> +    /** ATSC CC data CEA-608/708 \
> +     * - encoding: unused\
> +     * - decoding: Set by libavcodec
> +     */\
> +    uint8_t atsc_cc_buf[1024];\
> +    int atsc_cc_len;\

adding 1kb to every AVFrame of every codec is not ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100411/d870103b/attachment.pgp>



More information about the ffmpeg-devel mailing list