diff mbox series

[FFmpeg-devel,3/3] avcodec/libx264: remove separate libx264rgb RGB wrapper

Message ID 20210701215447.34169-4-jeebjp@gmail.com
State Superseded
Headers show
Series libx264 configure check clean-up, removal of libx264rgb
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Jan Ekström July 1, 2021, 9:54 p.m. UTC
No other encoder wrapper in libavcodec is split like this, and
with RGB input this currently does not lead to 4:2:0 (which would
be generally supported in most hardware and software implementations),
but rather 4:4:4.

The libx262 encoder definition was not touched, as it already has
4:4:4 YCbCr defined for it, which as far as I can tell is not supported.
---
 doc/encoders.texi      |  7 ++++---
 libavcodec/allcodecs.c |  1 -
 libavcodec/libx264.c   | 43 ++++++------------------------------------
 libavcodec/version.h   |  2 +-
 4 files changed, 11 insertions(+), 42 deletions(-)
diff mbox series

Patch

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 4c38996372..e60ffe9c7d 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2280,7 +2280,7 @@  Text-like
 
 @end table
 
-@section libx264, libx264rgb
+@section libx264
 
 x264 H.264/MPEG-4 AVC encoder wrapper.
 
@@ -2302,8 +2302,9 @@  by the libx264 @code{x264_param_parse} function.
 The x264 project website is at
 @url{http://www.videolan.org/developers/x264.html}.
 
-The libx264rgb encoder is the same as libx264, except it accepts packed RGB
-pixel formats as input instead of YUV.
+Since libavcodec 59.4.100 the libx264 encoder wrapper now supports both
+YCbCr as well as packed RGB pixel formats, and the separate libx264rgb
+wrapper has been removed.
 
 @subsection Supported Pixel Formats
 
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 623db2a9fa..d1a5dfdb75 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -772,7 +772,6 @@  extern const AVCodec ff_libx262_encoder;
 #endif
 extern LIBX264_CONST AVCodec ff_libx264_encoder;
 #endif
-extern const AVCodec ff_libx264rgb_encoder;
 extern AVCodec ff_libx265_encoder;
 extern const AVCodec ff_libxavs_encoder;
 extern const AVCodec ff_libxavs2_encoder;
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index fdb9e285a6..b31814bd4b 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -975,6 +975,9 @@  static const enum AVPixelFormat pix_fmts_8bit[] = {
     AV_PIX_FMT_YUVJ422P,
     AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_YUVJ444P,
+    AV_PIX_FMT_BGR0,
+    AV_PIX_FMT_BGR24,
+    AV_PIX_FMT_RGB24,
     AV_PIX_FMT_NV12,
     AV_PIX_FMT_NV16,
 #ifdef X264_CSP_NV21
@@ -1001,6 +1004,9 @@  static const enum AVPixelFormat pix_fmts_all[] = {
     AV_PIX_FMT_YUVJ422P,
     AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_YUVJ444P,
+    AV_PIX_FMT_BGR0,
+    AV_PIX_FMT_BGR24,
+    AV_PIX_FMT_RGB24,
     AV_PIX_FMT_NV12,
     AV_PIX_FMT_NV16,
 #ifdef X264_CSP_NV21
@@ -1017,13 +1023,6 @@  static const enum AVPixelFormat pix_fmts_all[] = {
     AV_PIX_FMT_NONE
 };
 
-static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
-    AV_PIX_FMT_BGR0,
-    AV_PIX_FMT_BGR24,
-    AV_PIX_FMT_RGB24,
-    AV_PIX_FMT_NONE
-};
-
 #if X264_BUILD < 153
 static av_cold void X264_init_static(AVCodec *codec)
 {
@@ -1183,36 +1182,6 @@  AVCodec ff_libx264_encoder = {
                       ,
     .wrapper_name     = "libx264",
 };
-
-static const AVClass rgbclass = {
-    .class_name = "libx264rgb",
-    .item_name  = av_default_item_name,
-    .option     = options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
-const AVCodec ff_libx264rgb_encoder = {
-    .name           = "libx264rgb",
-    .long_name      = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
-                      AV_CODEC_CAP_OTHER_THREADS |
-                      AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
-    .priv_data_size = sizeof(X264Context),
-    .init           = X264_init,
-    .encode2        = X264_frame,
-    .close          = X264_close,
-    .priv_class     = &rgbclass,
-    .defaults       = x264_defaults,
-    .pix_fmts       = pix_fmts_8bit_rgb,
-    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS
-#if X264_BUILD >= 158
-                      | FF_CODEC_CAP_INIT_THREADSAFE
-#endif
-                      ,
-    .wrapper_name   = "libx264",
-};
 #endif
 
 #if CONFIG_LIBX262_ENCODER
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 2a420a7e28..554f293aad 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@ 
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  59
-#define LIBAVCODEC_VERSION_MINOR   3
+#define LIBAVCODEC_VERSION_MINOR   4
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \