From eb358539be9ce1d5be317dd5e9839e26173cea2d Mon Sep 17 00:00:00 2001 From: Sanchay Sinha <100801@ittiam.com> Date: Wed, 4 Dec 2024 20:18:57 +0530 Subject: [PATCH] changed default preset from medium to superfast for software x264 codec --- .../com/facebook/encapp/BufferTranscoder.java | 1 + proto/tests.proto | 2 +- scripts/proto_tool/tests_pb2.py | 20 +++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/facebook/encapp/BufferTranscoder.java b/app/src/main/java/com/facebook/encapp/BufferTranscoder.java index 950463f..9717d4a 100644 --- a/app/src/main/java/com/facebook/encapp/BufferTranscoder.java +++ b/app/src/main/java/com/facebook/encapp/BufferTranscoder.java @@ -605,6 +605,7 @@ void bufferTranscoding(int trackIndex) throws IOException { } String preset = mTest.getEncoderX264().getPreset(); + Log.d(TAG, "preset value : " + preset); String colorSpace = mTest.getEncoderX264().getColorSpace(); int bitDepth = mTest.getEncoderX264().getBitdepth(); int threads = mTest.getEncoderX264().getThreads(); diff --git a/proto/tests.proto b/proto/tests.proto index 72f9e73..032d613 100644 --- a/proto/tests.proto +++ b/proto/tests.proto @@ -147,7 +147,7 @@ message Serial { } message EncoderX264 { - optional string preset = 1 [default = "medium"]; + optional string preset = 1 [default = "superfast"]; optional string colorSpace = 2 [default = "yuv420p"]; optional int32 bitdepth = 3 [default = 8]; optional string outputFile = 4 [default = "x264Output.mp4"]; diff --git a/scripts/proto_tool/tests_pb2.py b/scripts/proto_tool/tests_pb2.py index df9cff0..5a64ded 100644 --- a/scripts/proto_tool/tests_pb2.py +++ b/scripts/proto_tool/tests_pb2.py @@ -13,7 +13,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btests.proto\"K\n\x06\x43ommon\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x11\n\toperation\x18\x03 \x01(\t\x12\r\n\x05start\x18\x04 \x01(\t\"W\n\tParameter\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x04type\x18\x02 \x01(\x0e\x32\x0e.DataValueType\x12\r\n\x05value\x18\x03 \x01(\t\x12\x10\n\x08\x66ramenum\x18\x04 \x01(\x03\"\xd9\x01\n\x05Input\x12\x10\n\x08\x66ilepath\x18\x01 \x01(\t\x12\x12\n\nresolution\x18\x02 \x01(\t\x12\x18\n\x07pix_fmt\x18\x03 \x01(\x0e\x32\x07.PixFmt\x12\x11\n\tframerate\x18\x04 \x01(\x02\x12\x16\n\x0eplayout_frames\x18\x05 \x01(\x05\x12\x0f\n\x07pursuit\x18\x06 \x01(\x05\x12\x10\n\x08realtime\x18\x07 \x01(\x08\x12\x14\n\x0cstoptime_sec\x18\x08 \x01(\x02\x12\x0c\n\x04show\x18\t \x01(\x08\x12\x1e\n\x16loopback_totalDuration\x18\n \x01(\x03\"\xd3\x08\n\tConfigure\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\r\n\x05\x63odec\x18\x02 \x01(\t\x12\x0e\n\x06\x65ncode\x18\x03 \x01(\x08\x12\x0f\n\x07surface\x18\x04 \x01(\x08\x12\x0c\n\x04mime\x18\x05 \x01(\t\x12\x0f\n\x07\x62itrate\x18\x06 \x01(\t\x12,\n\x0c\x62itrate_mode\x18\x07 \x01(\x0e\x32\x16.Configure.BitrateMode\x12\x12\n\ndurationUs\x18\x08 \x01(\x04\x12\x12\n\nresolution\x18\t \x01(\t\x12\x14\n\x0c\x63olor_format\x18\n \x01(\x05\x12\x30\n\x0e\x63olor_standard\x18\x0b \x01(\x0e\x32\x18.Configure.ColorStandard\x12*\n\x0b\x63olor_range\x18\x0c \x01(\x0e\x32\x15.Configure.ColorRange\x12\x30\n\x0e\x63olor_transfer\x18\r \x01(\x0e\x32\x18.Configure.ColorTransfer\x12\x1e\n\x16\x63olor_transfer_request\x18\x0e \x01(\t\x12\x11\n\tframerate\x18\x0f \x01(\x02\x12\x18\n\x10i_frame_interval\x18\x10 \x01(\x05\x12\x1c\n\x14intra_refresh_period\x18\x11 \x01(\x05\x12\x0f\n\x07latency\x18\x12 \x01(\x05\x12#\n\x1brepeat_previous_frame_after\x18\x13 \x01(\x03\x12\x11\n\tts_schema\x18\x14 \x01(\t\x12\x0f\n\x07quality\x18\x15 \x01(\x05\x12\x12\n\ncomplexity\x18\x16 \x01(\x05\x12\x1a\n\x0b\x64\x65\x63ode_dump\x18\x17 \x01(\x08:\x05\x66\x61lse\x12*\n\x0b\x61vc_profile\x18\x18 \x01(\x0e\x32\x15.Configure.AVCProfile\x12,\n\x0chevc_profile\x18\x19 \x01(\x0e\x32\x16.Configure.HEVCProfile\x12!\n\x10\x64ownscale_filter\x18\x1a \x01(\t:\x07lanczos\"3\n\x0b\x42itrateMode\x12\x06\n\x02\x63q\x10\x00\x12\x07\n\x03vbr\x10\x01\x12\x07\n\x03\x63\x62r\x10\x02\x12\n\n\x06\x63\x62r_fd\x10\x03\"E\n\rColorStandard\x12\r\n\tbt601_pal\x10\x02\x12\x0e\n\nbt601_ntsc\x10\x04\x12\t\n\x05\x62t709\x10\x01\x12\n\n\x06\x62t2020\x10\x06\"#\n\nColorRange\x12\x08\n\x04\x66ull\x10\x01\x12\x0b\n\x07limited\x10\x02\"?\n\rColorTransfer\x12\n\n\x06linear\x10\x01\x12\r\n\tsdr_video\x10\x03\x12\n\n\x06st2084\x10\x06\x12\x07\n\x03hlg\x10\x07\"`\n\nAVCProfile\x12\x19\n\x13\x63onstrainedBaseline\x10\x80\x80\x04\x12\x0c\n\x08\x62\x61seline\x10\x01\x12\x08\n\x04main\x10\x02\x12\x08\n\x04high\x10\x08\x12\x15\n\x0f\x63onstrainedHigh\x10\x80\x80 \"&\n\x0bHEVCProfile\x12\x08\n\x04Main\x10\x01\x12\r\n\tmainStill\x10\x04\"\xc0\x02\n\x07Runtime\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\x35\n\rvideo_bitrate\x18\x02 \x03(\x0b\x32\x1e.Runtime.VideoBitrateParameter\x12\x0c\n\x04\x64rop\x18\x03 \x03(\x03\x12=\n\x11\x64ynamic_framerate\x18\x04 \x03(\x0b\x32\".Runtime.DynamicFramerateParameter\x12\x14\n\x0crequest_sync\x18\x05 \x03(\x03\x1a:\n\x15VideoBitrateParameter\x12\x10\n\x08\x66ramenum\x18\x01 \x01(\x03\x12\x0f\n\x07\x62itrate\x18\x02 \x01(\t\x1a@\n\x19\x44ynamicFramerateParameter\x12\x10\n\x08\x66ramenum\x18\x01 \x01(\x03\x12\x11\n\tframerate\x18\x02 \x01(\x02\"@\n\x10\x44\x65\x63oderConfigure\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\r\n\x05\x63odec\x18\x02 \x01(\t\"/\n\x0e\x44\x65\x63oderRuntime\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\"\x1f\n\x08Parallel\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test\"\x1d\n\x06Serial\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test\"\x8f\x01\n\x0b\x45ncoderX264\x12\x16\n\x06preset\x18\x01 \x01(\t:\x06medium\x12\x1b\n\ncolorSpace\x18\x02 \x01(\t:\x07yuv420p\x12\x13\n\x08\x62itdepth\x18\x03 \x01(\x05:\x01\x38\x12\"\n\noutputFile\x18\x04 \x01(\t:\x0ex264Output.mp4\x12\x12\n\x07threads\x18\x05 \x01(\x05:\x01\x38\"\x88\x02\n\x04Test\x12\x17\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\x07.Common\x12\x15\n\x05input\x18\x02 \x01(\x0b\x32\x06.Input\x12\x1d\n\tconfigure\x18\x03 \x01(\x0b\x32\n.Configure\x12\x19\n\x07runtime\x18\x04 \x01(\x0b\x32\x08.Runtime\x12,\n\x11\x64\x65\x63oder_configure\x18\x05 \x01(\x0b\x32\x11.DecoderConfigure\x12(\n\x0f\x64\x65\x63oder_runtime\x18\x06 \x01(\x0b\x32\x0f.DecoderRuntime\x12\x1b\n\x08parallel\x18\x07 \x01(\x0b\x32\t.Parallel\x12!\n\x0b\x65ncoderX264\x18\x08 \x01(\x0b\x32\x0c.EncoderX264\" \n\tTestSuite\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test*I\n\rDataValueType\x12\x0e\n\nstringType\x10\x00\x12\x0b\n\x07intType\x10\x01\x12\r\n\tfloatType\x10\x02\x12\x0c\n\x08longType\x10\x03*L\n\x06PixFmt\x12\x0b\n\x07yuv420p\x10\x00\x12\x0b\n\x07yvu420p\x10\x01\x12\x08\n\x04nv12\x10\x02\x12\x08\n\x04nv21\x10\x03\x12\x08\n\x04rgba\x10\x04\x12\n\n\x06p010le\x10\x36\x42-\n\x19\x63om.facebook.encapp.protoB\x0eTestDefinitionP\x01') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btests.proto\"K\n\x06\x43ommon\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x11\n\toperation\x18\x03 \x01(\t\x12\r\n\x05start\x18\x04 \x01(\t\"W\n\tParameter\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x04type\x18\x02 \x01(\x0e\x32\x0e.DataValueType\x12\r\n\x05value\x18\x03 \x01(\t\x12\x10\n\x08\x66ramenum\x18\x04 \x01(\x03\"\xd9\x01\n\x05Input\x12\x10\n\x08\x66ilepath\x18\x01 \x01(\t\x12\x12\n\nresolution\x18\x02 \x01(\t\x12\x18\n\x07pix_fmt\x18\x03 \x01(\x0e\x32\x07.PixFmt\x12\x11\n\tframerate\x18\x04 \x01(\x02\x12\x16\n\x0eplayout_frames\x18\x05 \x01(\x05\x12\x0f\n\x07pursuit\x18\x06 \x01(\x05\x12\x10\n\x08realtime\x18\x07 \x01(\x08\x12\x14\n\x0cstoptime_sec\x18\x08 \x01(\x02\x12\x0c\n\x04show\x18\t \x01(\x08\x12\x1e\n\x16loopback_totalDuration\x18\n \x01(\x03\"\xd3\x08\n\tConfigure\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\r\n\x05\x63odec\x18\x02 \x01(\t\x12\x0e\n\x06\x65ncode\x18\x03 \x01(\x08\x12\x0f\n\x07surface\x18\x04 \x01(\x08\x12\x0c\n\x04mime\x18\x05 \x01(\t\x12\x0f\n\x07\x62itrate\x18\x06 \x01(\t\x12,\n\x0c\x62itrate_mode\x18\x07 \x01(\x0e\x32\x16.Configure.BitrateMode\x12\x12\n\ndurationUs\x18\x08 \x01(\x04\x12\x12\n\nresolution\x18\t \x01(\t\x12\x14\n\x0c\x63olor_format\x18\n \x01(\x05\x12\x30\n\x0e\x63olor_standard\x18\x0b \x01(\x0e\x32\x18.Configure.ColorStandard\x12*\n\x0b\x63olor_range\x18\x0c \x01(\x0e\x32\x15.Configure.ColorRange\x12\x30\n\x0e\x63olor_transfer\x18\r \x01(\x0e\x32\x18.Configure.ColorTransfer\x12\x1e\n\x16\x63olor_transfer_request\x18\x0e \x01(\t\x12\x11\n\tframerate\x18\x0f \x01(\x02\x12\x18\n\x10i_frame_interval\x18\x10 \x01(\x05\x12\x1c\n\x14intra_refresh_period\x18\x11 \x01(\x05\x12\x0f\n\x07latency\x18\x12 \x01(\x05\x12#\n\x1brepeat_previous_frame_after\x18\x13 \x01(\x03\x12\x11\n\tts_schema\x18\x14 \x01(\t\x12\x0f\n\x07quality\x18\x15 \x01(\x05\x12\x12\n\ncomplexity\x18\x16 \x01(\x05\x12\x1a\n\x0b\x64\x65\x63ode_dump\x18\x17 \x01(\x08:\x05\x66\x61lse\x12*\n\x0b\x61vc_profile\x18\x18 \x01(\x0e\x32\x15.Configure.AVCProfile\x12,\n\x0chevc_profile\x18\x19 \x01(\x0e\x32\x16.Configure.HEVCProfile\x12!\n\x10\x64ownscale_filter\x18\x1a \x01(\t:\x07lanczos\"3\n\x0b\x42itrateMode\x12\x06\n\x02\x63q\x10\x00\x12\x07\n\x03vbr\x10\x01\x12\x07\n\x03\x63\x62r\x10\x02\x12\n\n\x06\x63\x62r_fd\x10\x03\"E\n\rColorStandard\x12\r\n\tbt601_pal\x10\x02\x12\x0e\n\nbt601_ntsc\x10\x04\x12\t\n\x05\x62t709\x10\x01\x12\n\n\x06\x62t2020\x10\x06\"#\n\nColorRange\x12\x08\n\x04\x66ull\x10\x01\x12\x0b\n\x07limited\x10\x02\"?\n\rColorTransfer\x12\n\n\x06linear\x10\x01\x12\r\n\tsdr_video\x10\x03\x12\n\n\x06st2084\x10\x06\x12\x07\n\x03hlg\x10\x07\"`\n\nAVCProfile\x12\x19\n\x13\x63onstrainedBaseline\x10\x80\x80\x04\x12\x0c\n\x08\x62\x61seline\x10\x01\x12\x08\n\x04main\x10\x02\x12\x08\n\x04high\x10\x08\x12\x15\n\x0f\x63onstrainedHigh\x10\x80\x80 \"&\n\x0bHEVCProfile\x12\x08\n\x04Main\x10\x01\x12\r\n\tmainStill\x10\x04\"\xc0\x02\n\x07Runtime\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\x35\n\rvideo_bitrate\x18\x02 \x03(\x0b\x32\x1e.Runtime.VideoBitrateParameter\x12\x0c\n\x04\x64rop\x18\x03 \x03(\x03\x12=\n\x11\x64ynamic_framerate\x18\x04 \x03(\x0b\x32\".Runtime.DynamicFramerateParameter\x12\x14\n\x0crequest_sync\x18\x05 \x03(\x03\x1a:\n\x15VideoBitrateParameter\x12\x10\n\x08\x66ramenum\x18\x01 \x01(\x03\x12\x0f\n\x07\x62itrate\x18\x02 \x01(\t\x1a@\n\x19\x44ynamicFramerateParameter\x12\x10\n\x08\x66ramenum\x18\x01 \x01(\x03\x12\x11\n\tframerate\x18\x02 \x01(\x02\"@\n\x10\x44\x65\x63oderConfigure\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\x12\r\n\x05\x63odec\x18\x02 \x01(\t\"/\n\x0e\x44\x65\x63oderRuntime\x12\x1d\n\tparameter\x18\x01 \x03(\x0b\x32\n.Parameter\"\x1f\n\x08Parallel\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test\"\x1d\n\x06Serial\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test\"\x92\x01\n\x0b\x45ncoderX264\x12\x19\n\x06preset\x18\x01 \x01(\t:\tsuperfast\x12\x1b\n\ncolorSpace\x18\x02 \x01(\t:\x07yuv420p\x12\x13\n\x08\x62itdepth\x18\x03 \x01(\x05:\x01\x38\x12\"\n\noutputFile\x18\x04 \x01(\t:\x0ex264Output.mp4\x12\x12\n\x07threads\x18\x05 \x01(\x05:\x01\x38\"\x88\x02\n\x04Test\x12\x17\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\x07.Common\x12\x15\n\x05input\x18\x02 \x01(\x0b\x32\x06.Input\x12\x1d\n\tconfigure\x18\x03 \x01(\x0b\x32\n.Configure\x12\x19\n\x07runtime\x18\x04 \x01(\x0b\x32\x08.Runtime\x12,\n\x11\x64\x65\x63oder_configure\x18\x05 \x01(\x0b\x32\x11.DecoderConfigure\x12(\n\x0f\x64\x65\x63oder_runtime\x18\x06 \x01(\x0b\x32\x0f.DecoderRuntime\x12\x1b\n\x08parallel\x18\x07 \x01(\x0b\x32\t.Parallel\x12!\n\x0b\x65ncoderX264\x18\x08 \x01(\x0b\x32\x0c.EncoderX264\" \n\tTestSuite\x12\x13\n\x04test\x18\x01 \x03(\x0b\x32\x05.Test*I\n\rDataValueType\x12\x0e\n\nstringType\x10\x00\x12\x0b\n\x07intType\x10\x01\x12\r\n\tfloatType\x10\x02\x12\x0c\n\x08longType\x10\x03*L\n\x06PixFmt\x12\x0b\n\x07yuv420p\x10\x00\x12\x0b\n\x07yvu420p\x10\x01\x12\x08\n\x04nv12\x10\x02\x12\x08\n\x04nv21\x10\x03\x12\x08\n\x04rgba\x10\x04\x12\n\n\x06p010le\x10\x36\x42-\n\x19\x63om.facebook.encapp.protoB\x0eTestDefinitionP\x01') _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tests_pb2', globals()) @@ -21,10 +21,10 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n\031com.facebook.encapp.protoB\016TestDefinitionP\001' - _DATAVALUETYPE._serialized_start=2460 - _DATAVALUETYPE._serialized_end=2533 - _PIXFMT._serialized_start=2535 - _PIXFMT._serialized_end=2611 + _DATAVALUETYPE._serialized_start=2463 + _DATAVALUETYPE._serialized_end=2536 + _PIXFMT._serialized_start=2538 + _PIXFMT._serialized_end=2614 _COMMON._serialized_start=15 _COMMON._serialized_end=90 _PARAMETER._serialized_start=92 @@ -60,9 +60,9 @@ _SERIAL._serialized_start=1982 _SERIAL._serialized_end=2011 _ENCODERX264._serialized_start=2014 - _ENCODERX264._serialized_end=2157 - _TEST._serialized_start=2160 - _TEST._serialized_end=2424 - _TESTSUITE._serialized_start=2426 - _TESTSUITE._serialized_end=2458 + _ENCODERX264._serialized_end=2160 + _TEST._serialized_start=2163 + _TEST._serialized_end=2427 + _TESTSUITE._serialized_start=2429 + _TESTSUITE._serialized_end=2461 # @@protoc_insertion_point(module_scope)