Verified Commit c52ca14f authored by Frederick Ding's avatar Frederick Ding
Browse files

New GitLab CI branch for FDK AAC using stripped library

parent efcfa6a8
Pipeline #339049045 passed with stages
in 56 minutes and 18 seconds
......@@ -10,7 +10,7 @@ variables:
SIGNTIMESTAMPSERVER: ""
SIGNFLATPAK: "false"
SIGNPGPKEY: "" # set in secret variables as file; passphrase not supported
BUILDFDK: "false" # this flag controls whether or not to build with AAC
BUILDFDK: "true" # this flag controls whether or not to build with AAC
MSBUILDPATH: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin"
# this is only needed if building for Linux
......
$(eval $(call import.MODULE.defs,FDKAAC,fdkaac))
$(eval $(call import.CONTRIB.defs,FDKAAC))
FDKAAC.FETCH.url = https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs/fdk-aac-2.0.1.tar.gz
FDKAAC.FETCH.url += https://github.com/mstorsjo/fdk-aac/archive/v2.0.1.tar.gz
FDKAAC.FETCH.sha256 = a4142815d8d52d0e798212a5adea54ecf42bcd4eec8092b37a8cb615ace91dc6
FDKAAC.FETCH.url = https://s3.amazonaws.com/cdn.frederickding.com/fdk-aac/fdk-aac-2.0.0-stripped4.tar.gz
FDKAAC.FETCH.sha256 = d3acd594ccf264227c2a7a0a1565d2e6496bbbbc29cf029cac4f293ca0c46de6
FDKAAC.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache configure; autoreconf -I m4 -fiv;
......
......@@ -390,7 +390,6 @@ hb_encoder_internal_t hb_audio_encoders[] =
{ { "AAC (CoreAudio)", "ca_aac", "AAC (Apple AudioToolbox)", HB_ACODEC_CA_AAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC, },
{ { "HE-AAC (CoreAudio)", "ca_haac", "HE-AAC (Apple AudioToolbox)", HB_ACODEC_CA_HAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC_HE, },
{ { "AAC (FDK)", "fdk_aac", "AAC (libfdk_aac)", HB_ACODEC_FDK_AAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC, },
{ { "HE-AAC (FDK)", "fdk_haac", "HE-AAC (libfdk_aac)", HB_ACODEC_FDK_HAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC_HE, },
{ { "AAC (avcodec)", "av_aac", "AAC (libavcodec)", HB_ACODEC_FFAAC, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC, },
{ { "AAC Passthru", "copy:aac", "AAC Passthru", HB_ACODEC_AAC_PASS, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AAC_PASS, },
{ { "AC3", "ac3", "AC3 (libavcodec)", HB_ACODEC_AC3, HB_MUX_MASK_MP4|HB_MUX_MASK_MKV, }, NULL, 0, 1, HB_GID_ACODEC_AC3, },
......@@ -432,7 +431,6 @@ static int hb_audio_encoder_is_enabled(int encoder)
#endif
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
return avcodec_find_encoder_by_name("libfdk_aac") != NULL;
case HB_ACODEC_AC3:
......@@ -846,12 +844,6 @@ int hb_audio_samplerate_is_supported(int samplerate, uint32_t codec)
return 0;
else
return 1;
case HB_ACODEC_FDK_HAAC:
// fdk_haac can't do samplerates < 16 kHz
if (samplerate < 16000)
return 0;
else
return 1;
case HB_ACODEC_OPUS:
switch (samplerate)
{
......@@ -1055,7 +1047,6 @@ int hb_audio_bitrate_get_default(uint32_t codec, int samplerate, int mixdown)
break;
case HB_ACODEC_CA_HAAC:
case HB_ACODEC_FDK_HAAC:
bitrate = nchannels * 32;
break;
......@@ -1289,13 +1280,6 @@ void hb_audio_bitrate_get_limits(uint32_t codec, int samplerate, int mixdown,
*high = nchannels * samplerate * 6 / 1000;
break;
case HB_ACODEC_FDK_HAAC:
*low = (nchannels * (12 + (4 * (samplerate >= 44100))));
*high = (nchannels - (nchannels > 2)) * (48 +
(16 *
(samplerate >= 22050)));
break;
case HB_ACODEC_FFAAC:
*low = ((nchannels + lfe_count) * 32);
*high = ((nchannels + lfe_count) *
......@@ -1697,7 +1681,6 @@ void hb_audio_quality_get_limits(uint32_t codec, float *low, float *high,
*high = 10.;
break;
case HB_ACODEC_FDK_HAAC:
case HB_ACODEC_FDK_AAC:
*direction = 0;
*granularity = 1.;
......@@ -1753,7 +1736,6 @@ float hb_audio_quality_get_default(uint32_t codec)
case HB_ACODEC_FFAAC:
return 5.;
case HB_ACODEC_FDK_HAAC:
case HB_ACODEC_FDK_AAC:
return 3.;
......@@ -1977,7 +1959,6 @@ int hb_mixdown_has_codec_support(int mixdown, uint32_t codec)
return (mixdown <= HB_AMIXDOWN_DOLBYPLII);
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
return ((mixdown <= HB_AMIXDOWN_5POINT1) ||
(mixdown == HB_AMIXDOWN_7POINT1));
......@@ -2128,7 +2109,6 @@ int hb_mixdown_get_default(uint32_t codec, uint64_t layout)
case HB_ACODEC_CA_HAAC:
case HB_ACODEC_FFAAC:
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
mixdown = HB_AMIXDOWN_7POINT1;
break;
......
......@@ -92,19 +92,11 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
break;
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
codec_name = "libfdk_aac";
sample_fmt = AV_SAMPLE_FMT_S16;
bits_per_raw_sample = 16;
switch (audio->config.out.codec)
{
case HB_ACODEC_FDK_HAAC:
profile = FF_PROFILE_AAC_HE;
break;
default:
profile = FF_PROFILE_AAC_LOW;
break;
}
profile = FF_PROFILE_AAC_LOW;
// FFmpeg's libfdk-aac wrapper expects back channels for 5.1
// audio, and will error out unless we translate the layout
if (channel_layout == AV_CH_LAYOUT_5POINT1)
......@@ -191,8 +183,7 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
{
context->global_quality = audio->config.out.quality * FF_QP2LAMBDA;
context->flags |= AV_CODEC_FLAG_QSCALE;
if (audio->config.out.codec == HB_ACODEC_FDK_AAC ||
audio->config.out.codec == HB_ACODEC_FDK_HAAC)
if (audio->config.out.codec == HB_ACODEC_FDK_AAC)
{
char vbr[8];
snprintf(vbr, 8, "%.1g", audio->config.out.quality);
......
......@@ -811,7 +811,6 @@ struct hb_job_s
#define HB_ACODEC_FFFLAC 0x00100000
#define HB_ACODEC_FFFLAC24 0x00200000
#define HB_ACODEC_FDK_AAC 0x00400000
#define HB_ACODEC_FDK_HAAC 0x00800000
#define HB_ACODEC_FFEAC3 0x01000000
#define HB_ACODEC_FFTRUEHD 0x02000000
#define HB_ACODEC_OPUS 0x04000000
......
......@@ -668,7 +668,6 @@ static int avformatInit( hb_mux_object_t * m )
case HB_ACODEC_CA_AAC:
case HB_ACODEC_CA_HAAC:
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
track->st->codecpar->codec_id = AV_CODEC_ID_AAC;
// libav mkv muxer expects there to be extradata for
......@@ -797,7 +796,6 @@ static int avformatInit( hb_mux_object_t * m )
case HB_ACODEC_CA_AAC:
case HB_ACODEC_CA_HAAC:
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
break;
default:
......@@ -816,8 +814,7 @@ static int avformatInit( hb_mux_object_t * m )
(codec == HB_ACODEC_FFAAC ||
codec == HB_ACODEC_CA_AAC ||
codec == HB_ACODEC_CA_HAAC ||
codec == HB_ACODEC_FDK_AAC ||
codec == HB_ACODEC_FDK_HAAC))
codec == HB_ACODEC_FDK_AAC))
{
hb_mux_data_t * fallback_track;
int * sd;
......
......@@ -71,7 +71,6 @@ namespace HandBrakeWPF.Converters.Audio
if (!HandBrakeEncoderHelpers.AudioEncoders.Any(a => a.ShortName.Contains("fdk")))
{
encoders.Remove(AudioEncoder.fdkaac);
encoders.Remove(AudioEncoder.fdkheaac);
}
if (outputFormat == OutputFormat.Mp4)
......
......@@ -28,10 +28,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
[ShortName("fdk_aac")]
fdkaac,
[DisplayName("HE-AAC (FDK)")]
[ShortName("fdk_haac")]
fdkheaac,
[DisplayName("MP3")]
[ShortName("mp3")]
Lame,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment