File: dscalerapi.h

package info (click to toggle)
tvtime 1.0.2-10
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 7,464 kB
  • sloc: ansic: 30,160; sh: 9,612; makefile: 624; pascal: 504; yacc: 316; asm: 249; perl: 192; cpp: 164
file content (102 lines) | stat: -rw-r--r-- 3,376 bytes parent folder | download | duplicates (6)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
///////////////////////////////////////////////////////////////////////////////
// $Id: dscalerapi.h,v 1.2 2004/08/14 03:25:15 vektor Exp $
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000 John Adcock.  All rights reserved.
/////////////////////////////////////////////////////////////////////////////
// This header file is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// This software 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 Library General Public License for more details
///////////////////////////////////////////////////////////////////////////////

/**
 * This file is an adaptation of the DS_ApiCommon.h file from DScaler.  I have
 * removed many of the features which are not required by the tvtime port at
 * the current time, and just store here the structures needed by the
 * deinterlacers.  We may try to converge back with DScaler or KDETV's
 * adaptation in the future.  -Billy Biggs
 */

#ifndef __DS_APICOMON_H__
#define __DS_APICOMON_H__ 1

#include <stdlib.h>

/** Deinterlace functions return true if the overlay is ready to be displayed.
*/
typedef void (MEMCPY_FUNC)(void* pOutput, const void* pInput, size_t nSize);

#define MAX_PICTURE_HISTORY 10

#define PICTURE_PROGRESSIVE 0
#define PICTURE_INTERLACED_ODD 1
#define PICTURE_INTERLACED_EVEN 2
#define PICTURE_INTERLACED_MASK (PICTURE_INTERLACED_ODD | PICTURE_INTERLACED_EVEN)

/** Structure containing a single field or frame
    from the source.

    This may be modified
*/

typedef struct
{
    // pointer to the start of data for this picture
    unsigned char* pData;
    // see PICTURE_ flags
    unsigned int Flags;
} TPicture;


#define DEINTERLACE_INFO_CURRENT_VERSION 400

/** Structure used to transfer all the information used by plugins
    around in one chunk
*/
typedef struct
{
    /** The most recent pictures 
        PictureHistory[0] is always the most recent.
        Pointers are NULL if the picture in question isn't valid, e.g. because
        the program just started or a picture was skipped.
    */
    TPicture* PictureHistory[MAX_PICTURE_HISTORY];

    /// Current overlay buffer pointer.
    unsigned char *Overlay;

    /// Overlay pitch (number of bytes between scanlines).
    unsigned int OverlayPitch;

    /** Number of bytes of actual data in each scanline.  May be less than
        OverlayPitch since the overlay's scanlines might have alignment
        requirements.  Generally equal to FrameWidth * 2.
    */
    unsigned int LineLength;

    /// Number of pixels in each scanline.
    int FrameWidth;

    /// Number of scanlines per frame.
    int FrameHeight;

    /** Number of scanlines per field.  FrameHeight / 2, mostly for
        cleanliness so we don't have to keep dividing FrameHeight by 2.
    */
    int FieldHeight;

    /// Function pointer to optimized memcpy function
    MEMCPY_FUNC* pMemcpy;

    /** distance between lines in image
        need not match the pixel width
    */
    unsigned int InputPitch;
} TDeinterlaceInfo;

#endif