"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavfilter/vf_yadif.c" between
libav-12.1.tar.gz and libav-12.2.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

vf_yadif.c  (libav-12.1):vf_yadif.c  (libav-12.2)
skipping to change at line 43 skipping to change at line 43
#include <assert.h> #include <assert.h>
typedef struct ThreadData { typedef struct ThreadData {
AVFrame *frame; AVFrame *frame;
int plane; int plane;
int w, h; int w, h;
int parity; int parity;
int tff; int tff;
} ThreadData; } ThreadData;
#define MAX_ALIGN 8
#define CHECK(j)\ #define CHECK(j)\
{ int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\ { int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\
+ FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\ + FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
+ FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\ + FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\
if (score < spatial_score) {\ if (score < spatial_score) {\
spatial_score= score;\ spatial_score= score;\
spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\ spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\
/* The is_not_edge argument here controls when the code will enter a branch /* The is_not_edge argument here controls when the code will enter a branch
* which reads up to and including x-3 and x+3. */ * which reads up to and including x-3 and x+3. */
skipping to change at line 126 skipping to change at line 128
int w, int prefs, int mrefs, int parity, int mode) int w, int prefs, int mrefs, int parity, int mode)
{ {
uint8_t *dst = dst1; uint8_t *dst = dst1;
uint8_t *prev = prev1; uint8_t *prev = prev1;
uint8_t *cur = cur1; uint8_t *cur = cur1;
uint8_t *next = next1; uint8_t *next = next1;
int x; int x;
uint8_t *prev2 = parity ? prev : cur ; uint8_t *prev2 = parity ? prev : cur ;
uint8_t *next2 = parity ? cur : next; uint8_t *next2 = parity ? cur : next;
const int edge = MAX_ALIGN - 1;
/* Only edge pixels need to be processed here. A constant value of false /* Only edge pixels need to be processed here. A constant value of false
* for is_not_edge should let the compiler ignore the whole branch. */ * for is_not_edge should let the compiler ignore the whole branch. */
FILTER(0, 3, 0) FILTER(0, 3, 0)
dst = (uint8_t*)dst1 + w - 3; dst = (uint8_t*)dst1 + w - edge;
prev = (uint8_t*)prev1 + w - 3; prev = (uint8_t*)prev1 + w - edge;
cur = (uint8_t*)cur1 + w - 3; cur = (uint8_t*)cur1 + w - edge;
next = (uint8_t*)next1 + w - 3; next = (uint8_t*)next1 + w - edge;
prev2 = (uint8_t*)(parity ? prev : cur); prev2 = (uint8_t*)(parity ? prev : cur);
next2 = (uint8_t*)(parity ? cur : next); next2 = (uint8_t*)(parity ? cur : next);
FILTER(w - edge, w - 3, 1)
FILTER(w - 3, w, 0) FILTER(w - 3, w, 0)
} }
static void filter_line_c_16bit(void *dst1, static void filter_line_c_16bit(void *dst1,
void *prev1, void *cur1, void *next1, void *prev1, void *cur1, void *next1,
int w, int prefs, int mrefs, int parity, int w, int prefs, int mrefs, int parity,
int mode) int mode)
{ {
uint16_t *dst = dst1; uint16_t *dst = dst1;
uint16_t *prev = prev1; uint16_t *prev = prev1;
skipping to change at line 168 skipping to change at line 173
static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1, static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,
int w, int prefs, int mrefs, int parity, int mode ) int w, int prefs, int mrefs, int parity, int mode )
{ {
uint16_t *dst = dst1; uint16_t *dst = dst1;
uint16_t *prev = prev1; uint16_t *prev = prev1;
uint16_t *cur = cur1; uint16_t *cur = cur1;
uint16_t *next = next1; uint16_t *next = next1;
int x; int x;
uint16_t *prev2 = parity ? prev : cur ; uint16_t *prev2 = parity ? prev : cur ;
uint16_t *next2 = parity ? cur : next; uint16_t *next2 = parity ? cur : next;
const int edge = MAX_ALIGN / 2 - 1;
mrefs /= 2; mrefs /= 2;
prefs /= 2; prefs /= 2;
FILTER(0, 3, 0) FILTER(0, 3, 0)
dst = (uint16_t*)dst1 + w - 3; dst = (uint16_t*)dst1 + w - edge;
prev = (uint16_t*)prev1 + w - 3; prev = (uint16_t*)prev1 + w - edge;
cur = (uint16_t*)cur1 + w - 3; cur = (uint16_t*)cur1 + w - edge;
next = (uint16_t*)next1 + w - 3; next = (uint16_t*)next1 + w - edge;
prev2 = (uint16_t*)(parity ? prev : cur); prev2 = (uint16_t*)(parity ? prev : cur);
next2 = (uint16_t*)(parity ? cur : next); next2 = (uint16_t*)(parity ? cur : next);
FILTER(w - edge, w - 3, 1)
FILTER(w - 3, w, 0) FILTER(w - 3, w, 0)
} }
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{ {
YADIFContext *s = ctx->priv; YADIFContext *s = ctx->priv;
ThreadData *td = arg; ThreadData *td = arg;
int refs = s->cur->linesize[td->plane]; int refs = s->cur->linesize[td->plane];
int df = (s->csp->comp[td->plane].depth + 7) / 8; int df = (s->csp->comp[td->plane].depth + 7) / 8;
int pix_3 = 3 * df; int pix_3 = 3 * df;
int slice_h = td->h / nb_jobs; int slice_h = td->h / nb_jobs;
int slice_start = jobnr * slice_h; int slice_start = jobnr * slice_h;
int slice_end = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h; int slice_end = (jobnr == nb_jobs - 1) ? td->h : (jobnr + 1) * slice_h;
int y; int y;
int edge = 3 + MAX_ALIGN / df - 1;
/* filtering reads 3 pixels to the left/right; to avoid invalid reads, /* filtering reads 3 pixels to the left/right; to avoid invalid reads,
* we need to call the c variant which avoids this for border pixels * we need to call the c variant which avoids this for border pixels
*/ */
for (y = slice_start; y < slice_end; y++) { for (y = slice_start; y < slice_end; y++) {
if ((y ^ td->parity) & 1) { if ((y ^ td->parity) & 1) {
uint8_t *prev = &s->prev->data[td->plane][y * refs]; uint8_t *prev = &s->prev->data[td->plane][y * refs];
uint8_t *cur = &s->cur ->data[td->plane][y * refs]; uint8_t *cur = &s->cur ->data[td->plane][y * refs];
uint8_t *next = &s->next->data[td->plane][y * refs]; uint8_t *next = &s->next->data[td->plane][y * refs];
uint8_t *dst = &td->frame->data[td->plane][y * td->frame->linesize[ td->plane]]; uint8_t *dst = &td->frame->data[td->plane][y * td->frame->linesize[ td->plane]];
int mode = y == 1 || y + 2 == td->h ? 2 : s->mode; int mode = y == 1 || y + 2 == td->h ? 2 : s->mode;
s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3, s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,
next + pix_3, td->w - 6, next + pix_3, td->w - edge,
y + 1 < td->h ? refs : -refs, y + 1 < td->h ? refs : -refs,
y ? -refs : refs, y ? -refs : refs,
td->parity ^ td->tff, mode); td->parity ^ td->tff, mode);
s->filter_edges(dst, prev, cur, next, td->w, s->filter_edges(dst, prev, cur, next, td->w,
y + 1 < td->h ? refs : -refs, y + 1 < td->h ? refs : -refs,
y ? -refs : refs, y ? -refs : refs,
td->parity ^ td->tff, mode); td->parity ^ td->tff, mode);
} else { } else {
memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane ]], memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane ]],
&s->cur->data[td->plane][y * refs], td->w * df); &s->cur->data[td->plane][y * refs], td->w * df);
 End of changes. 9 change blocks. 
9 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)