]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
move filter_hw_denoise and filter_hw_sharpness to tvh_codec_profile_video
authorUkn Unknown <4031821+uknunknown@users.noreply.github.com>
Sat, 31 May 2025 18:09:56 +0000 (11:09 -0700)
committerFlole <Flole998@users.noreply.github.com>
Sun, 20 Jul 2025 03:11:35 +0000 (05:11 +0200)
fixes: https://github.com/tvheadend/tvheadend/issues/1818
also fixes a logical define bug: filter_denoise and filter_sharpness should be transferred for all HW accels (not only for VAAPI)

src/transcoding/codec.h
src/transcoding/codec/internals.h
src/transcoding/transcode/video.c

index f5b5fde78def556396b4e79e4f2483d4f19558f8..97a25e498ec6ff6e4d879c94f7499d727e2e559c 100644 (file)
@@ -92,9 +92,8 @@ struct tvh_codec_profile {
     double bit_rate;
     double qscale;
     int profile;
+    // to be moved when we remove ENABLE_FFMPEG4_TRANSCODING
     int low_power;
-    int filter_hw_denoise;
-    int filter_hw_sharpness;
     char *device; // for hardware acceleration
     LIST_ENTRY(tvh_codec_profile) link;
 };
index 2a0aef986f10f99360049957b907aebde3ca7b0b..e74e15b91f11badd976a1ed73d2481fdef23ed86 100644 (file)
@@ -290,13 +290,59 @@ extern const codec_profile_class_t codec_profile_video_class;
 
 typedef struct tvh_codec_profile_video {
     TVHCodecProfile;
+    /**
+     * SW or HW deinterlace  (applies for decoding)
+     * @note
+     * int: 
+     * VALUE - deinterlace enable
+     * 
+     * - 0 - disabled
+     * 
+     * - 1 - enabled
+     */
     int deinterlace;
     int height;
-    int scaling_mode;   // 0 --> up&down; 1 --> up; 2 --> down
+    /**
+     * SW or HW scaling mode  (applies for decoding)
+     * @note
+     * int: 
+     * VALUE - scaling mode
+     * 
+     * - 0 - scaling up or down
+     * 
+     * - 1 - scaling only up
+     * 
+     * - 2 - scaling only down
+     */
+    int scaling_mode;
     int hwaccel;
     int hwaccel_details;
     int pix_fmt;
     int crf;
+#if ENABLE_HWACCELS
+    /**
+     * HW accel denoise filter (applies for decoding)
+     * @note
+     * int: 
+     * VALUE - hardware denoise
+     * 
+     * - 0 - disabled (not sent to ffmpeg)
+     * 
+     * - >0 - denoise level value (max value different per platform)
+     */
+    int filter_hw_denoise;
+    /**
+     * HW accel sharpness filter (applies for decoding)
+     * @note
+     * int: 
+     * VALUE - hardware sharpness
+     * 
+     * - 0 - disabled (not sent to ffmpeg)
+     * 
+     * - >0 - sharpness level value (max value different per platform)
+     */
+    int filter_hw_sharpness;
+#endif
     AVRational size;
 } TVHVideoCodecProfile;
 
index 37edc4c25ee5c8171722670faa0622f1a108fe3d..ae221d9a2d53c2a6b8d599c37ba88c9153d78906 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "internals.h"
+#include "../codec/internals.h"
 
 #if ENABLE_HWACCELS
 #include "hwaccels/hwaccels.h"
@@ -60,9 +61,9 @@ _video_filters_get_filters(TVHContext *self, AVDictionary **opts, char **filters
     if (tvh_context_get_int_opt(opts, "tvh_filter_deint", &filter_deint)) {
         return -1;
     }
-#if ENABLE_VAAPI
-    filter_denoise = self->profile->filter_hw_denoise;
-    filter_sharpness = self->profile->filter_hw_sharpness;
+#if ENABLE_HWACCELS
+    filter_denoise = ((TVHVideoCodecProfile *)self->profile)->filter_hw_denoise;
+    filter_sharpness = ((TVHVideoCodecProfile *)self->profile)->filter_hw_sharpness;
 #endif
     //  in --> out  |  download   |   upload 
     // -------------|-------------|------------