From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 02/15] avcodec/mpegutils: Move definitions to better places Date: Fri, 5 Apr 2024 14:41:25 +0200 Message-ID: <GV1P250MB07377DBDB55BF53423C01B198F032@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <GV1P250MB0737AB31294010EE180AF5828F032@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> FRAME_SKIPPED -> h263dec.h CANDIDATE_MB_TYPE_* -> mpegvideoenc.h INPLACE_OFFSET -> mpegvideoenc.h enum OutputFormat -> mpegvideo.h Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/h263dec.c | 1 - libavcodec/h263dec.h | 5 +++++ libavcodec/intelh263dec.c | 2 -- libavcodec/mpeg4videoenc.c | 1 - libavcodec/mpegpicture.c | 2 +- libavcodec/mpegutils.h | 34 ---------------------------------- libavcodec/mpegvideo.h | 12 +++++++++--- libavcodec/mpegvideoenc.h | 19 +++++++++++++++++++ libavcodec/nvdec_mpeg12.c | 1 + libavcodec/ratecontrol.c | 1 - libavcodec/rv10.c | 1 - libavcodec/vc1dec.c | 1 + 12 files changed, 36 insertions(+), 44 deletions(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 910df7585f..48bd467f30 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -42,7 +42,6 @@ #include "mpeg4video.h" #include "mpeg4videodec.h" #include "mpeg4videodefs.h" -#include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "msmpeg4dec.h" diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h index 89c5fcf58f..a01acc0834 100644 --- a/libavcodec/h263dec.h +++ b/libavcodec/h263dec.h @@ -23,6 +23,11 @@ #include "mpegvideo.h" #include "vlc.h" +/** + * Return value for header parsers if frame is not coded. + * */ +#define FRAME_SKIPPED 100 + // The defines below define the number of bits that are read at once for // reading vlc values. Changing these may improve speed and data cache needs // be aware though that decreasing them may need the number of stages that is diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index f8eeb6b44e..5d34892ef7 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -19,12 +19,10 @@ */ #include "codec_internal.h" -#include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "h263data.h" #include "h263dec.h" -#include "mpegvideodata.h" /* don't understand why they choose a different header ! */ int ff_intel_h263_decode_picture_header(MpegEncContext *s) diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index f806ad8a74..71dda802e2 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -26,7 +26,6 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "codec_internal.h" -#include "mpegutils.h" #include "mpegvideo.h" #include "h263.h" #include "h263enc.h" diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 5bf85bb7fe..06b6daa01a 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -29,7 +29,7 @@ #include "avcodec.h" #include "motion_est.h" #include "mpegpicture.h" -#include "mpegutils.h" +#include "mpegvideo.h" #include "refstruct.h" #include "threadframe.h" diff --git a/libavcodec/mpegutils.h b/libavcodec/mpegutils.h index 386110bb8c..3da1e7ed38 100644 --- a/libavcodec/mpegutils.h +++ b/libavcodec/mpegutils.h @@ -27,11 +27,6 @@ #include "avcodec.h" -/** - * Return value for header parsers if frame is not coded. - * */ -#define FRAME_SKIPPED 100 - /* picture type */ #define PICT_TOP_FIELD 1 #define PICT_BOTTOM_FIELD 2 @@ -93,35 +88,6 @@ #define HAS_CBP(a) ((a) & MB_TYPE_CBP) -/* MB types for encoding */ -#define CANDIDATE_MB_TYPE_INTRA (1 << 0) -#define CANDIDATE_MB_TYPE_INTER (1 << 1) -#define CANDIDATE_MB_TYPE_INTER4V (1 << 2) -#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3) - -#define CANDIDATE_MB_TYPE_DIRECT (1 << 4) -#define CANDIDATE_MB_TYPE_FORWARD (1 << 5) -#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6) -#define CANDIDATE_MB_TYPE_BIDIR (1 << 7) - -#define CANDIDATE_MB_TYPE_INTER_I (1 << 8) -#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9) -#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10) -#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11) - -#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12) - -#define INPLACE_OFFSET 16 - -enum OutputFormat { - FMT_MPEG1, - FMT_H261, - FMT_H263, - FMT_MJPEG, - FMT_SPEEDHQ, -}; - - /** * Draw a horizontal band if supported. * diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index d7c2f57682..215df0fd5b 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -28,7 +28,6 @@ #ifndef AVCODEC_MPEGVIDEO_H #define AVCODEC_MPEGVIDEO_H -#include "avcodec.h" #include "blockdsp.h" #include "error_resilience.h" #include "fdctdsp.h" @@ -44,7 +43,6 @@ #include "pixblockdsp.h" #include "put_bits.h" #include "ratecontrol.h" -#include "mpegutils.h" #include "qpeldsp.h" #include "videodsp.h" @@ -61,6 +59,14 @@ typedef struct ScanTable { uint8_t raster_end[64]; } ScanTable; +enum OutputFormat { + FMT_MPEG1, + FMT_H261, + FMT_H263, + FMT_MJPEG, + FMT_SPEEDHQ, +}; + /** * MpegEncContext. */ @@ -283,7 +289,7 @@ typedef struct MpegEncContext { int mb_x, mb_y; int mb_skip_run; int mb_intra; - uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegutils.h) + uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegvideoenc.h) int block_index[6]; ///< index to current MB in block based arrays with edges int block_wrap[6]; diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h index 1e29782660..c20ea500eb 100644 --- a/libavcodec/mpegvideoenc.h +++ b/libavcodec/mpegvideoenc.h @@ -34,6 +34,25 @@ #include "mpegvideo.h" #define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level)) +#define INPLACE_OFFSET 16 + +/* MB types for encoding */ +#define CANDIDATE_MB_TYPE_INTRA (1 << 0) +#define CANDIDATE_MB_TYPE_INTER (1 << 1) +#define CANDIDATE_MB_TYPE_INTER4V (1 << 2) +#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3) + +#define CANDIDATE_MB_TYPE_DIRECT (1 << 4) +#define CANDIDATE_MB_TYPE_FORWARD (1 << 5) +#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6) +#define CANDIDATE_MB_TYPE_BIDIR (1 << 7) + +#define CANDIDATE_MB_TYPE_INTER_I (1 << 8) +#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9) +#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10) +#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11) + +#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12) /* mpegvideo_enc common options */ #define FF_MPV_FLAG_SKIP_RD 0x0001 diff --git a/libavcodec/nvdec_mpeg12.c b/libavcodec/nvdec_mpeg12.c index a4603c7ea7..139f287617 100644 --- a/libavcodec/nvdec_mpeg12.c +++ b/libavcodec/nvdec_mpeg12.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "hwaccel_internal.h" #include "internal.h" +#include "mpegutils.h" #include "mpegvideo.h" #include "nvdec.h" #include "decode.h" diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index 1ff209c00b..9ee08ecb88 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -32,7 +32,6 @@ #include "avcodec.h" #include "ratecontrol.h" -#include "mpegutils.h" #include "mpegvideoenc.h" #include "libavutil/eval.h" diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index d32faa628b..df487b24a9 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -38,7 +38,6 @@ #include "h263data.h" #include "h263dec.h" #include "mpeg_er.h" -#include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "mpeg4video.h" diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 2c413e0bf1..3b5b016cf9 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -36,6 +36,7 @@ #include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" +#include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" #include "msmpeg4_vc1_data.h" -- 2.40.1 _______________________________________________ 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".
next prev parent reply other threads:[~2024-04-05 12:41 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-05 12:33 [FFmpeg-devel] [PATCH 01/15] avcodec/mpegvideo_enc: Don't update current_picture unnecessarily Andreas Rheinhardt 2024-04-05 12:41 ` Andreas Rheinhardt [this message] 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 03/15] avcodec/mpeg12: Remove always-false check Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 04/15] avcodec/mpegvideo_dec, mpeg12dec: Move MPEG1/2 code to mpeg12dec.c Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 05/15] avcodec/mpeg12dec: Remove redundant check Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 06/15] avcodec/mpeg12dec: Don't pretend MPEG-1/2 to support alpha Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 07/15] avcodec/mpegvideo_dec: Don't emit non-keyframe warning for H.261 Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 08/15] avcodec/mpeg12dec: Remove unnecessary FFCodec.close Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 09/15] avcodec/mpegvideo_dec: Remove obsolete current_picture_ptr reuse code Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 10/15] avcodec/mpegvideo_dec: Remove redundant code to reset keyframe flag Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 11/15] avcodec/mpegvideo_dec: Factor allocating dummy frame out Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 12/15] avcodec/mpegvideo_dec: Move getting Picture slot into alloc_picture() Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 13/15] avcodec/mpegvideo: Remove pointless check Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 14/15] avcodec/mpeg12dec: Remove redundant mpeg_enc_ctx_allocated Andreas Rheinhardt 2024-04-05 12:41 ` [FFmpeg-devel] [PATCH 15/15] avcodec/mpegvideo_dec, h264_slice: Return proper error codes Andreas Rheinhardt 2024-04-07 22:34 ` [FFmpeg-devel] [PATCH 01/15] avcodec/mpegvideo_enc: Don't update current_picture unnecessarily Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=GV1P250MB07377DBDB55BF53423C01B198F032@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git