This source file includes following definitions.
- change_video_tables
- change_video_minbitrate
- get_video_recorded_size_kb
- set_quality
- set_movie_time_limit
- bitrate_calc
1 #include "platform.h"
2
3 #ifdef CAM_MOVIEREC_NEWSTYLE
4
5 #include "conf.h"
6 #include "clock.h"
7
8 static int bitrate_multi_a, bitrate_multi_b;
9 static int mbitrate_multi_a, mbitrate_multi_b;
10 static unsigned int recorded_kb;
11
12
13
14
15
16 void change_video_tables(int a, int b) {
17 bitrate_multi_a = a;
18 bitrate_multi_b = b;
19 }
20 void change_video_minbitrate(int a, int b) {
21 mbitrate_multi_a = a;
22 mbitrate_multi_b = b;
23 }
24 unsigned int get_video_recorded_size_kb() {
25 return recorded_kb;
26 }
27
28
29
30
31
32
33
34
35 void set_quality(int *struc){
36 int low = *(struc+BR_LOW_OFS/4);
37 int mid = *(struc+BR_MID_OFS/4);
38 int hgh = *(struc+BR_HI_OFS/4);
39 if (conf.video_mode == 1) {
40 hgh = hgh * bitrate_multi_a / bitrate_multi_b;
41 if (hgh > MAX_VIDEO_BITRATE) hgh = MAX_VIDEO_BITRATE;
42 mid = (hgh > 400) ? hgh-100 : hgh-(hgh>>2);
43 low = (mid > 400) ? mid-100 : mid-(mid>>2);
44 }
45 else if (conf.video_mode == 2) {
46 hgh = hgh * bitrate_multi_a / bitrate_multi_b;
47 if (hgh > MAX_VIDEO_BITRATE) hgh = MAX_VIDEO_BITRATE;
48 low = hgh * mbitrate_multi_a / mbitrate_multi_b;
49 mid = (hgh-low > 400) ? hgh-100 : hgh-((hgh-low)>>2);
50 }
51 else if (conf.video_mode == 3) {
52 hgh = hgh * bitrate_multi_a / bitrate_multi_b;
53 if (hgh > MAX_VIDEO_BITRATE) hgh = MAX_VIDEO_BITRATE;
54 low = hgh * mbitrate_multi_a / mbitrate_multi_b;
55 mid = (hgh + low) / 2;
56 }
57 else if (conf.video_mode == 4) {
58 hgh = hgh * bitrate_multi_a / bitrate_multi_b;
59 if (hgh > MAX_VIDEO_BITRATE) hgh = MAX_VIDEO_BITRATE;
60 low = hgh * mbitrate_multi_a / mbitrate_multi_b;
61 mid = (hgh-low > 400) ? low+100 : low+((hgh-low)>>2);
62 }
63 if ((hgh>0) && (mid>0) && (low>0)) {
64 *(struc+BR_LOW_OFS/4) = low;
65 *(struc+BR_MID_OFS/4) = mid;
66 *(struc+BR_HI_OFS/4) = hgh;
67 }
68
69 recorded_kb = 0;
70 }
71
72 int set_movie_time_limit(int limit) {
73
74 if ((conf.ext_video_time == 1) && (limit <= FW_SHORT_TIME_LIMIT)) {
75
76 return SHORT_TIME_LIMIT;
77 }
78
79 return LONG_TIME_LIMIT;
80 }
81
82 void bitrate_calc(unsigned int sum) {
83 recorded_kb += sum / 1024;
84 }
85