aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/samsung/mfc5x/mfc_enc.h
blob: 4bca251d2bbb82b7a8e6507e9b4eaff72643c054 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * linux/drivers/media/video/samsung/mfc5x/mfc_enc.h
 *
 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * Encoder interface for Samsung MFC (Multi Function Codec - FIMV) driver
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __MFC_ENC_H
#define __MFC_ENC_H __FILE__

#include <linux/list.h>

#include "mfc.h"
#include "mfc_interface.h"
#include "mfc_inst.h"

enum enc_pc {
	EPC_ENABLE	= 0,
	EPC_DISABLE	= 3,
};

struct mfc_enc_ctx {
	unsigned int lumasize;		/* C */
	unsigned int chromasize;	/* C */

	unsigned long streamaddr;	/* K */
	unsigned int streamsize;	/* K */

	/* FIXME: temp. */
	unsigned char *kstrmaddr;

	/* init */
	enum enc_pc pixelcache;
	unsigned int numdpb;

	/* init | exec */
	unsigned int framemap;
	unsigned int inputformat;
#if SUPPORT_SLICE_ENCODING
	unsigned int outputmode;
#endif

	/* exec */
	unsigned int interlace;
	unsigned int forceframe;
	unsigned int frameskip;
	unsigned int framerate;
	unsigned int bitrate;
	unsigned int iperiodval;
	unsigned int vuiinfoval;
	unsigned int vuiextendsar;

	unsigned int frame_skip_enable;
	unsigned int vui_info_enable;
	unsigned int hier_p_enable;
#if SUPPORT_SLICE_ENCODING
	unsigned int slicecount;
	unsigned int slicesize;
#endif
	/* change flag */
	unsigned int setflag;
	unsigned int FrameTypeCngTag;
	unsigned int FrameRateCngTag;
	unsigned int BitRateCngTag;
	unsigned int FrameSkipCngTag;
	unsigned int VUIInfoCngTag;
	unsigned int IPeriodCngTag;
	unsigned int HierPCngTag;

	void *e_priv;
};

#define CHG_FRAME_PACKING	0x00000001
#define CHG_I_PERIOD		0x00000002
struct mfc_enc_h264 {
	unsigned int change;
	unsigned int vui_enable;
	unsigned int hier_p_enable;

	unsigned int i_period;

	unsigned int sei_gen;		/* H */
	struct mfc_frame_packing fp;	/* H */
};

int mfc_init_encoding(struct mfc_inst_ctx *ctx, union mfc_args *args);
/*
int mfc_init_encoding(struct mfc_inst_ctx *ctx, struct mfc_dec_init_arg *init_arg);
*/
int mfc_exec_encoding(struct mfc_inst_ctx *ctx, union mfc_args *args);
/*
int mfc_exec_encoding(struct mfc_inst_ctx *ctx, struct mfc_dec_exe_arg *exe_arg);
*/

/*---------------------------------------------------------------------------*/

struct mfc_enc_info {
	struct list_head list;
	const char *name;
	SSBSIP_MFC_CODEC_TYPE codectype;
	int codecid;
	unsigned int e_priv_size;

	const struct codec_operations c_ops;
};

void mfc_init_encoders(void);

#endif /* __MFC_ENC_H */