You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavfi/unsharp: use the same macros used in the original MP filter
Remove possibly pointless inconsistency with the ported code. Also specify parameter value ranges consistent with those of the ported filter.
This commit is contained in:
committed by
Stefano Sabatini
parent
772b949d8e
commit
7ac3ccc5f2
@@ -4925,11 +4925,11 @@ equivalent of the string '5:5:1.0:5:5:0.0'.
|
|||||||
|
|
||||||
@item luma_msize_x
|
@item luma_msize_x
|
||||||
Set the luma matrix horizontal size. It can be an integer between 3
|
Set the luma matrix horizontal size. It can be an integer between 3
|
||||||
and 13, default value is 5.
|
and 63, default value is 5.
|
||||||
|
|
||||||
@item luma_msize_y
|
@item luma_msize_y
|
||||||
Set the luma matrix vertical size. It can be an integer between 3
|
Set the luma matrix vertical size. It can be an integer between 3
|
||||||
and 13, default value is 5.
|
and 63, default value is 5.
|
||||||
|
|
||||||
@item luma_amount
|
@item luma_amount
|
||||||
Set the luma effect strength. It can be a float number between -2.0
|
Set the luma effect strength. It can be a float number between -2.0
|
||||||
@@ -4937,11 +4937,11 @@ and 5.0, default value is 1.0.
|
|||||||
|
|
||||||
@item chroma_msize_x
|
@item chroma_msize_x
|
||||||
Set the chroma matrix horizontal size. It can be an integer between 3
|
Set the chroma matrix horizontal size. It can be an integer between 3
|
||||||
and 13, default value is 5.
|
and 63, default value is 5.
|
||||||
|
|
||||||
@item chroma_msize_y
|
@item chroma_msize_y
|
||||||
Set the chroma matrix vertical size. It can be an integer between 3
|
Set the chroma matrix vertical size. It can be an integer between 3
|
||||||
and 13, default value is 5.
|
and 63, default value is 5.
|
||||||
|
|
||||||
@item chroma_amount
|
@item chroma_amount
|
||||||
Set the chroma effect strength. It can be a float number between -2.0
|
Set the chroma effect strength. It can be a float number between -2.0
|
||||||
|
@@ -44,8 +44,8 @@
|
|||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
|
|
||||||
#define MIN_SIZE 3
|
#define MIN_MATRIX_SIZE 3
|
||||||
#define MAX_SIZE 13
|
#define MAX_MATRIX_SIZE 63
|
||||||
|
|
||||||
/* right-shift and round-up */
|
/* right-shift and round-up */
|
||||||
#define SHIFTUP(x,shift) (-((-(x))>>(shift)))
|
#define SHIFTUP(x,shift) (-((-(x))>>(shift)))
|
||||||
@@ -58,7 +58,7 @@ typedef struct FilterParam {
|
|||||||
int steps_y; ///< vertical step count
|
int steps_y; ///< vertical step count
|
||||||
int scalebits; ///< bits to shift pixel
|
int scalebits; ///< bits to shift pixel
|
||||||
int32_t halfscale; ///< amount to add to pixel
|
int32_t halfscale; ///< amount to add to pixel
|
||||||
uint32_t *sc[(MAX_SIZE * MAX_SIZE) - 1]; ///< finite state machine storage
|
uint32_t *sc[MAX_MATRIX_SIZE - 1]; ///< finite state machine storage
|
||||||
} FilterParam;
|
} FilterParam;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -72,7 +72,7 @@ static void apply_unsharp( uint8_t *dst, int dst_stride,
|
|||||||
int width, int height, FilterParam *fp)
|
int width, int height, FilterParam *fp)
|
||||||
{
|
{
|
||||||
uint32_t **sc = fp->sc;
|
uint32_t **sc = fp->sc;
|
||||||
uint32_t sr[(MAX_SIZE * MAX_SIZE) - 1], tmp1, tmp2;
|
uint32_t sr[MAX_MATRIX_SIZE - 1], tmp1, tmp2;
|
||||||
|
|
||||||
int32_t res;
|
int32_t res;
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
|
Reference in New Issue
Block a user