File: deinterlace_scale.c

package info (click to toggle)
gavl 1.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 14,912 kB
  • sloc: ansic: 437,319; sh: 10,487; makefile: 238
file content (57 lines) | stat: -rw-r--r-- 2,064 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*****************************************************************
 * gavl - a general purpose audio/video processing library
 *
 * Copyright (c) 2001 - 2011 Members of the Gmerlin project
 * gmerlin-general@lists.sourceforge.net
 * http://gmerlin.sourceforge.net
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * *****************************************************************/

#include <gavl/gavl.h>
#include <video.h>
#include <deinterlace.h>

static void deinterlace_scale(gavl_video_deinterlacer_t * d,
                              const gavl_video_frame_t * in,
                              gavl_video_frame_t * out)
  { 
  gavl_video_scaler_scale(d->scaler, in, out);
  }

int gavl_deinterlacer_init_scale(gavl_video_deinterlacer_t * d)
  {
  gavl_video_options_t * scaler_opt;
  gavl_video_format_t in_format;
  gavl_video_format_t out_format;
  
  if(!d->scaler)
    d->scaler = gavl_video_scaler_create();
  scaler_opt = gavl_video_scaler_get_options(d->scaler);
  gavl_video_options_copy(scaler_opt, &d->opt);
  
  gavl_video_format_copy(&in_format, &d->format);
  gavl_video_format_copy(&out_format, &d->format);
  
  if(in_format.interlace_mode == GAVL_INTERLACE_NONE)
    in_format.interlace_mode = GAVL_INTERLACE_TOP_FIRST;
  out_format.interlace_mode = GAVL_INTERLACE_NONE;
  
  gavl_video_scaler_init(d->scaler, 
                         &in_format,
                         &out_format);
  
  d->func = deinterlace_scale;
  return 1; 
  }