summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2008-08-14 14:06:44 +0000
committerjbrjake <[email protected]>2008-08-14 14:06:44 +0000
commit02bb82d6cd84500e6348ef89deeb282fd6d75e40 (patch)
tree6f3982cbd488fcaed280ac9d0c2eb353139559d6
parent5e393b0ea0e4cebb6bb302658ee576b617dd769d (diff)
Code comment clean-up, mostly to clarify the difference between the prev and next frame buffers and yadif's prev2 and next2 field pointers.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1630 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/decomb.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libhb/decomb.c b/libhb/decomb.c
index 1b18328d4..1360e4345 100644
--- a/libhb/decomb.c
+++ b/libhb/decomb.c
@@ -346,7 +346,7 @@ int tritical_detect_comb( hb_filter_private_t * pv )
int athresh_squared = athresh * athresh;
int athresh6 = 6 *athresh;
- /* One pas for Y, one pass for Cb, one pass for Cr */
+ /* One pas for Y, one pass for U, one pass for V */
for( k = 0; k < 1; k++ )
{
int ref_stride = pv->ref_stride[k];
@@ -488,9 +488,12 @@ static void yadif_filter_line( uint8_t *dst,
int y,
hb_filter_private_t * pv )
{
+ /* While prev and next point to the previous and next frames,
+ prev2 and next2 will shift depending on the parity, usually 1.
+ They are the previous and next fields, the fields temporally adjacent
+ to the other field in the current frame--the one not being filtered. */
uint8_t *prev2 = parity ? prev : cur ;
uint8_t *next2 = parity ? cur : next;
-
int w = pv->width[plane];
int refs = pv->ref_stride[plane];
int x;
@@ -499,16 +502,16 @@ static void yadif_filter_line( uint8_t *dst,
{
/* Pixel above*/
int c = cur[-refs];
- /* Temporal average -- the current pixel location in the previous and next fields */
+ /* Temporal average: the current location in the adjacent fields */
int d = (prev2[0] + next2[0])>>1;
/* Pixel below */
int e = cur[+refs];
- /* How the current pixel changes from the field before to the field after */
+ /* How the current pixel changes between the adjacent fields */
int temporal_diff0 = ABS(prev2[0] - next2[0]);
- /* The average of how much the pixels above and below change from the field before to now. */
+ /* The average of how much the pixels above and below change from the frame before to now. */
int temporal_diff1 = ( ABS(prev[-refs] - cur[-refs]) + ABS(prev[+refs] - cur[+refs]) ) >> 1;
- /* The average of how much the pixels above and below change from now to the next field. */
+ /* The average of how much the pixels above and below change from now to the next frame. */
int temporal_diff2 = ( ABS(next[-refs] - cur[-refs]) + ABS(next[+refs] - cur[+refs]) ) >> 1;
/* For the actual difference, use the largest of the previous average diffs. */
int diff = MAX3(temporal_diff0>>1, temporal_diff1, temporal_diff2);
@@ -566,8 +569,8 @@ static void yadif_filter_line( uint8_t *dst,
YADIF_CHECK(-1) YADIF_CHECK(-2) }} }}
YADIF_CHECK( 1) YADIF_CHECK( 2) }} }}
- /* Temporally adjust the spatial prediction by comparing
- against fields in the previous and next frames. */
+ /* Temporally adjust the spatial prediction by
+ comparing against lines in the adjacent fields. */
int b = (prev2[-2*refs] + next2[-2*refs])>>1;
int f = (prev2[+2*refs] + next2[+2*refs])>>1;