Skip to content

Commit 0647374

Browse files
committed
Remove dead code
1 parent ac6bf94 commit 0647374

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

servers/movie_writer/movie_writer_ogv.cpp

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,7 @@ Error MovieWriterOGV::write_begin(const Size2i &p_movie_size, uint32_t p_fps, co
174174

175175
// Initialize Vorbis audio encoding.
176176
vorbis_info_init(&vi);
177-
int ret = 0;
178-
if (audio_bitrate == 0) {
179-
ret = vorbis_encode_init_vbr(&vi, audio_ch, mix_rate, audio_quality);
180-
} else {
181-
ret = vorbis_encode_init(&vi, audio_ch, mix_rate, -1, (int)(64870 * (ogg_int64_t)audio_bitrate >> 16), -1);
182-
}
177+
int ret = vorbis_encode_init_vbr(&vi, audio_ch, mix_rate, audio_quality);
183178
ERR_FAIL_COND_V_MSG(ret, ERR_UNAVAILABLE, "The Ogg Vorbis encoder couldn't set up a mode according to the requested quality or bitrate.");
184179

185180
vorbis_comment_init(&vc);
@@ -230,43 +225,6 @@ Error MovieWriterOGV::write_begin(const Size2i &p_movie_size, uint32_t p_fps, co
230225
ERR_PRINT("Couldn't set keyframe interval.");
231226
}
232227

233-
if (vp3_compatible) {
234-
ret = th_encode_ctl(td, TH_ENCCTL_SET_VP3_COMPATIBLE, &vp3_compatible, sizeof(vp3_compatible));
235-
if (ret < 0) {
236-
ERR_PRINT("Could not enable strict VP3 compatibility");
237-
}
238-
}
239-
240-
// Reverse the rate control flags to favor a "long time" strategy.
241-
if (soft_target) {
242-
int arg = TH_RATECTL_CAP_UNDERFLOW;
243-
ret = th_encode_ctl(td, TH_ENCCTL_SET_RATE_FLAGS, &arg, sizeof(arg));
244-
if (ret < 0) {
245-
ERR_PRINT("Couldn't set encoder flags for soft-target.");
246-
}
247-
248-
if (buffer_delay < 0) {
249-
if ((keyframe_frequency * 7 >> 1) > 5 * fps) {
250-
arg = keyframe_frequency * 7 >> 1;
251-
} else {
252-
arg = 5 * fps;
253-
}
254-
ret = th_encode_ctl(td, TH_ENCCTL_SET_RATE_BUFFER, &arg, sizeof(arg));
255-
if (ret < 0) {
256-
ERR_PRINT("Couldn't set rate control buffer for soft-target.");
257-
}
258-
}
259-
}
260-
261-
// Now we can set the buffer delay if the user requested a non-default one
262-
// (this has to be done after two-pass is enabled).
263-
if (buffer_delay >= 0) {
264-
ret = th_encode_ctl(td, TH_ENCCTL_SET_RATE_BUFFER, &buffer_delay, sizeof(buffer_delay));
265-
if (ret < 0) {
266-
WARN_PRINT("Couldn't set desired buffer delay.");
267-
}
268-
}
269-
270228
// Speed should also be set after the current encoder mode is established,
271229
// since the available speed levels may change depending on the encoder mode.
272230
if (speed >= 0) {

servers/movie_writer/movie_writer_ogv.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,9 @@ class MovieWriterOGV : public MovieWriter {
5050

5151
Ref<FileAccess> f;
5252

53-
// Bitrate target for Vorbis audio.
54-
int audio_bitrate = 0;
55-
5653
// Vorbis quality -0.1 to 1 (-0.1 yields smallest files but lowest fidelity; 1 yields highest fidelity but large files. '0.2' is a reasonable default).
5754
float audio_quality = 0.2;
5855

59-
// VP3 strict compatibility.
60-
int vp3_compatible = 0;
61-
6256
// Bitrate target for Theora video.
6357
int video_bitrate = 0;
6458

@@ -68,21 +62,12 @@ class MovieWriterOGV : public MovieWriter {
6862
// Video stream keyframe frequency (one every N frames).
6963
ogg_uint32_t keyframe_frequency = 64;
7064

71-
// Buffer delay (in frames). Longer delays allow smoother rate adaptation and provide better overall quality, but require more
72-
// client side buffering and add latency. The default value is the keyframe interval for one-pass encoding (or somewhat larger if
73-
// soft-target is used).
74-
int buffer_delay = -1;
75-
7665
// Sets the encoder speed level. Higher speed levels favor quicker encoding over better quality per bit. Depending on the encoding
7766
// mode, and the internal algorithms used, quality may actually improve with higher speeds, but in this case bitrate will also
7867
// likely increase. The maximum value, and the meaning of each value, are implementation-specific and may change depending on the
7968
// current encoding mode.
8069
int speed = 4;
8170

82-
// Use a large reservoir and treat the rate as a soft target; rate control is less strict but resulting quality is usually
83-
// higher/smoother overall. Soft target also allows an optional setting to specify a minimum allowed quality.
84-
bool soft_target = true;
85-
8671
// Take physical pages, weld into a logical stream of packets.
8772
ogg_stream_state to;
8873

0 commit comments

Comments
 (0)