2
* Copyright (C) 2003 Billy Biggs <vektor@dumbterm.net>.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or (at
7
* your option) any later version.
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
#include "videocorrection.h"
24
#include "videofilter.h"
28
video_correction_t *vc;
35
uint8_t tempscanline[ 2048 ];
38
videofilter_t *videofilter_new( void )
40
videofilter_t *vf = malloc( sizeof( videofilter_t ) );
43
vf->vc = video_correction_new( 1, 0 );
44
vf->bt8x8_correction = 0;
45
vf->uyvy_conversion = 0;
46
vf->colour_invert = 0;
53
void videofilter_delete( videofilter_t *vf )
55
if( vf->vc ) video_correction_delete( vf->vc );
59
void videofilter_set_bt8x8_correction( videofilter_t *vf, int correct )
61
vf->bt8x8_correction = correct;
64
void videofilter_set_colour_invert( videofilter_t *vf, int invert )
66
vf->colour_invert = invert;
69
void videofilter_set_mirror( videofilter_t *vf, int mirror )
74
void videofilter_set_chroma_kill( videofilter_t *vf, int chromakill )
76
vf->chromakill = chromakill;
79
void videofilter_set_full_extent_correction( videofilter_t *vf, int correct )
83
void videofilter_set_luma_power( videofilter_t *vf, double power )
85
if( vf->vc ) video_correction_set_luma_power( vf->vc, power );
88
void videofilter_enable_uyvy_conversion( videofilter_t *vf )
90
vf->uyvy_conversion = 1;
93
int videofilter_active_on_scanline( videofilter_t *vf, int scanline )
95
if( vf->uyvy_conversion || vf->colour_invert || vf->mirror ||
96
vf->chromakill || (vf->vc && vf->bt8x8_correction) ) {
103
void videofilter_packed422_scanline( videofilter_t *vf, uint8_t *data,
104
int width, int xpos, int scanline )
106
if( vf->uyvy_conversion ) {
107
convert_uyvy_to_yuyv_scanline( data, data, width );
110
if( vf->vc && vf->bt8x8_correction ) {
111
video_correction_correct_packed422_scanline( vf->vc, data, data, width );
112
/* filter_luma_121_packed422_inplace_scanline( data, width ); */
113
/* filter_luma_14641_packed422_inplace_scanline( data, width ); */
114
/* halfmirror_packed422_inplace_scanline( data, width ); */
115
/* testing_packed422_inplace_scanline( data, width, scanline ); */
118
if( vf->colour_invert ) {
119
invert_colour_packed422_inplace_scanline( data, width );
123
mirror_packed422_inplace_scanline( data, width );
126
if( vf->chromakill ) {
127
kill_chroma_packed422_inplace_scanline( data, width );