How to migrate atadenoise in ffmpeg to my own project?

Viewed 201

This is the entrance to the atadenoise filter:

libavfilter/vf_atadenoise.c

static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
   ...
}

which is used to call

s->dsp.filter_row[p](src, dst, srcf, w, mid, size, thra, thrb, weights);

Therefore, the specific noise reduction method is selected according to the configured parameters:

static void fweight_row##name(const uint8_t *ssrc, uint8_t *ddst,           \
                              const uint8_t *ssrcf[SIZE],                   \
                              int w, int mid, int size,                     \
                              int thra, int thrb, const float *weights)     \
...

static void fweight_row##name##_serial(const uint8_t *ssrc, uint8_t *ddst,  \
                                       const uint8_t *ssrcf[SIZE],          \
                                       int w, int mid, int size,            \
                                       int thra, int thrb,                  \
                                       const float *weights)                \
                                       
.....                                       
          

I call atadenoise function with the example code:

doc/examples/filtering_video.c

// const char *filter_descr = "scale=78:24,transpose=cclock";
const char *filter_descr =
    "atadenoise=0a=0.2:1a=0.2:2a=0.2:0b=0.3:1b=0.3:2b=0.3";
/* other way:
   scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively
 */
 
 ......
 
int main(int argc, char **argv)
{
    int ret;
    AVPacket packet;
    AVFrame *frame;
    AVFrame *filt_frame;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s file\n", argv[0]);
        exit(1);
    }
......

configuring const char *filter_descr in this way to call atadenoise:

const char *filter_descr =
    "atadenoise=0a=0.2:1a=0.2:2a=0.2:0b=0.3:1b=0.3:2b=0.3";

If I want to connect atadenoise to my project, I should start from filter_slice. But I don't know how to feed parameters to it.

Currently I use Xcode to set break point in atadenoise, but that's not stable. And now I cannot break in to it. Maybe I have accidentally changed some configuration.

0 Answers
Related