Skip to content

Commit def641d

Browse files
committed
Plugins update for DEE 2.0.2
1 parent e864edc commit def641d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1512
-508
lines changed

plugins/code/hevc_dec/ffmpeg/make/hevc_dec_ffmpeg/linux_amd64_gnu/Makefile

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#-*-makefile-*-
22

33
BASE=../../../../../../
4-
CCDEP = $(CC)
4+
TMP=$(BASE)
5+
.PRECIOUS: %/..
6+
%/..:; @test $(dir $(basename $(@D))) | mkdir -p $(dir $(basename $(@D)))
7+
CXXDEP = $(CXX)
58
CXXFLAGS_debug = -std=c++11 -g -ggdb3 -O0 -fPIC -m64 -c -Wall
69
CXXFLAGS_release = -std=c++11 -O3 -ftree-vectorize -fPIC -m64 -c -Wall
710
DEFINES_release = -DNDEBUG=1
@@ -12,10 +15,10 @@ LDFLAGS_release = -O2 -fPIC -shared -m64
1215
LDLIBS = -ldl
1316

1417

15-
INPUTS_LINK_debug = $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o\
16-
$(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o
17-
INPUTS_LINK_release = $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.o $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.o\
18-
$(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.o
18+
INPUTS_LINK_debug = $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o\
19+
$(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o
20+
INPUTS_LINK_release = $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.o $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.o\
21+
$(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.o
1922

2023

2124
default: hevc_dec_ffmpeg_debug.so hevc_dec_ffmpeg_release.so
@@ -26,18 +29,18 @@ hevc_dec_ffmpeg_debug.so: $(INPUTS_LINK_debug)
2629
hevc_dec_ffmpeg_release.so: $(INPUTS_LINK_release)
2730
$(LD) $(LDFLAGS_release) -o $@ $+ $(LDLIBS)
2831

29-
%.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o: %.cpp
30-
$(CCDEP) -std=c++11 -MM $(INCLUDES) -MT $@ -o $*.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d $<
32+
$(TMP)%.hevc_dec_ffmpeg_linux_amd64_gnu_debug.o: $(BASE)%.cpp | $(TMP)%/..
33+
$(CXXDEP) -std=c++11 -MM $(INCLUDES) -MT $@ -o $(patsubst %.o,%.d,$@) $<
3134
$(CXX) $(CXXFLAGS_debug) $(INCLUDES) -o $@ $<
3235

33-
%.hevc_dec_ffmpeg_linux_amd64_gnu_release.o: %.cpp
34-
$(CCDEP) -std=c++11 -MM $(DEFINES_release) $(INCLUDES) -MT $@ -o $*.hevc_dec_ffmpeg_linux_amd64_gnu_release.d $<
36+
$(TMP)%.hevc_dec_ffmpeg_linux_amd64_gnu_release.o: $(BASE)%.cpp | $(TMP)%/..
37+
$(CXXDEP) -std=c++11 -MM $(DEFINES_release) $(INCLUDES) -MT $@ -o $(patsubst %.o,%.d,$@) $<
3538
$(CXX) $(CXXFLAGS_release) $(DEFINES_release) $(INCLUDES) -o $@ $<
3639

37-
CLEAN_COMPILE_debug = $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d\
38-
$(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d
39-
CLEAN_COMPILE_release = $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.d $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.d\
40-
$(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.d
40+
CLEAN_COMPILE_debug = $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d\
41+
$(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d
42+
CLEAN_COMPILE_release = $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.d $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.d\
43+
$(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.d
4144

4245
cleandeps:
4346
$(RM) $(CLEAN_COMPILE_debug)
@@ -66,11 +69,11 @@ help:
6669
@echo " cleandeps"
6770
@echo " help"
6871

69-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
70-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
71-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
72-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
73-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
74-
include $(wildcard $(BASE)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
72+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
73+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
74+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_debug.d)
75+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/NamedPipe.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
76+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
77+
include $(wildcard $(TMP)code/hevc_dec/ffmpeg/src/hevc_dec_ffmpeg_utils.hevc_dec_ffmpeg_linux_amd64_gnu_release.d)
7578

7679

plugins/code/hevc_dec/ffmpeg/make/hevc_dec_ffmpeg/windows_amd64_msvs/hevc_dec_ffmpeg_2013.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<CompileAs>Default</CompileAs>
4949
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
5050
<DisableSpecificWarnings />
51-
<ExceptionHandling />
51+
<ExceptionHandling>Sync</ExceptionHandling>
5252
<MinimalRebuild>false</MinimalRebuild>
5353
<Optimization>Disabled</Optimization>
5454
<DisableLanguageExtensions>false</DisableLanguageExtensions>
@@ -78,7 +78,7 @@
7878
<CompileAs>Default</CompileAs>
7979
<DebugInformationFormat />
8080
<DisableSpecificWarnings />
81-
<ExceptionHandling />
81+
<ExceptionHandling>Sync</ExceptionHandling>
8282
<MinimalRebuild>false</MinimalRebuild>
8383
<Optimization>MaxSpeed</Optimization>
8484
<DisableLanguageExtensions>false</DisableLanguageExtensions>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Dolby Encoding Engine plugin for HEVC decoding via ffmpeg.
2+
3+
Build tools:
4+
- Visual Studio 2013
5+
- gcc 4.8.5
6+
7+
Build instructions, Windows:
8+
1. Build using make\windows_amd64_msv\hevc_dec_ffmpeg_2013.sln
9+
2. Copy .dll library with plugin to DEE installation folder
10+
11+
Build instructions, Linux:
12+
1. Build using make/hevc_dec_ffmpeg/linux_amd64_gnu/Makefile
13+
- make hevc_dec_ffmpeg_release.so
14+
2. Copy .so library with plugin to DEE installation folder
15+
16+
The minimum required ffmpeg version is 3.4.2. Previous versions
17+
are built without the necessary 10-bit support on Windows.

plugins/code/hevc_dec/ffmpeg/scripts/cmd_gen_ffmpeg_decode.py

Lines changed: 9 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -11,147 +11,39 @@
1111
bit_depth = "8"
1212
width = "0"
1313
height = "0"
14-
color_space = "yuv420p"
15-
frame_rate = "24"
16-
data_rate = "0"
17-
max_vbv_data_rate = "0"
18-
vbv_buffer_size = "0"
1914
ffmpeg_bin = "ffmpeg.exe"
2015
input_file = "input_file"
2116
output_file = "output_file"
22-
multipass = "off"
23-
stats_file = ""
24-
color_description_present = 0
25-
color_primaries = 0
26-
transfer_characteristics = 0
27-
matrix_coefficients = 0
28-
light_level_information_sei_present = 0
29-
light_level_max_content = 0
30-
light_level_max_frame_average = 0
31-
mastering_display_sei_present = 0
32-
mastering_display_sei_x1 = 0
33-
mastering_display_sei_y1 = 0
34-
mastering_display_sei_x2 = 0
35-
mastering_display_sei_y2 = 0
36-
mastering_display_sei_x3 = 0
37-
mastering_display_sei_y3 = 0
38-
mastering_display_sei_wx = 0
39-
mastering_display_sei_wy = 0
40-
mastering_display_sei_max_lum = 0
41-
mastering_display_sei_min_lum = 0
4217

4318
for x in content:
4419
x.strip()
4520
split_line = x.split("=", 1)
4621

47-
if split_line[0] == "bit_depth":
22+
if split_line[0] == "output_bitdepth":
4823
bit_depth = split_line[1]
4924
elif split_line[0] == "width":
5025
width = split_line[1]
5126
elif split_line[0] == "height":
5227
height = split_line[1]
53-
elif split_line[0] == "color_space":
54-
color_space = split_line[1]
55-
elif split_line[0] == "frame_rate":
56-
frame_rate = split_line[1]
57-
elif split_line[0] == "data_rate":
58-
data_rate = split_line[1]
59-
elif split_line[0] == "max_vbv_data_rate":
60-
max_vbv_data_rate = split_line[1]
61-
elif split_line[0] == "vbv_buffer_size":
62-
vbv_buffer_size = split_line[1]
6328
elif split_line[0] == "input_file":
6429
input_file = split_line[1]
6530
elif split_line[0] == "output_file":
6631
output_file = split_line[1]
6732
elif split_line[0] == "ffmpeg_bin":
6833
ffmpeg_bin = split_line[1]
69-
elif split_line[0] == "multipass":
70-
multipass = split_line[1]
71-
elif split_line[0] == "stats_file":
72-
stats_file = split_line[1]
7334

74-
elif split_line[0] == "mastering_display_sei_present":
75-
mastering_display_sei_present = split_line[1]
76-
elif split_line[0] == "mastering_display_sei_x1":
77-
mastering_display_sei_x1 = split_line[1]
78-
elif split_line[0] == "mastering_display_sei_x2":
79-
mastering_display_sei_x2 = split_line[1]
80-
elif split_line[0] == "mastering_display_sei_x3":
81-
mastering_display_sei_x3 = split_line[1]
82-
elif split_line[0] == "mastering_display_sei_y1":
83-
mastering_display_sei_y1 = split_line[1]
84-
elif split_line[0] == "mastering_display_sei_y2":
85-
mastering_display_sei_y2 = split_line[1]
86-
elif split_line[0] == "mastering_display_sei_y3":
87-
mastering_display_sei_y3 = split_line[1]
88-
elif split_line[0] == "mastering_display_sei_wx":
89-
mastering_display_sei_wx = split_line[1]
90-
elif split_line[0] == "mastering_display_sei_wy":
91-
mastering_display_sei_wy = split_line[1]
92-
elif split_line[0] == "mastering_display_sei_max_lum":
93-
mastering_display_sei_max_lum = split_line[1]
94-
elif split_line[0] == "mastering_display_sei_min_lum":
95-
mastering_display_sei_min_lum = split_line[1]
96-
97-
elif split_line[0] == "color_description_present":
98-
color_description_present = split_line[1]
99-
elif split_line[0] == "color_primaries":
100-
color_primaries = split_line[1]
101-
elif split_line[0] == "transfer_characteristics":
102-
transfer_characteristics = split_line[1]
103-
elif split_line[0] == "matrix_coefficients":
104-
matrix_coefficients = split_line[1]
105-
106-
elif split_line[0] == "light_level_information_sei_present":
107-
light_level_information_sei_present = split_line[1]
108-
elif split_line[0] == "light_level_max_content":
109-
light_level_max_content = split_line[1]
110-
elif split_line[0] == "light_level_max_frame_average":
111-
light_level_max_frame_average = split_line[1]
112-
11335
command_line = ffmpeg_bin
114-
command_line += " -f rawvideo"
115-
command_line += " -s " + width + "x" + height
116-
command_line += " -pix_fmt " + color_space
11736

118-
if bit_depth == "10":
119-
command_line += "10le"
120-
121-
command_line += " -framerate " + frame_rate
37+
command_line += " -y -f hevc"
12238
command_line += " -i " + input_file
123-
command_line += " -c:v libx265 -x265-params \""
124-
125-
if multipass == "1st":
126-
command_line += "pass=1:"
127-
elif multipass == "last":
128-
command_line += "pass=2:"
129-
elif multipass == "nth":
130-
command_line += "pass=3:"
13139

132-
if multipass != "off":
133-
command_line += "stats=" + stats_file + ":"
134-
135-
if color_description_present == "1":
136-
command_line += "colorprim=" + color_primaries + ":"
137-
command_line += "transfer=" + transfer_characteristics + ":"
138-
command_line += "colormatrix=" + matrix_coefficients + ":"
139-
140-
if light_level_information_sei_present == "1":
141-
command_line += "max-cll=" + light_level_max_content + "," + light_level_max_frame_average + ":"
142-
143-
if mastering_display_sei_present == "1":
144-
command_line += "master-display="
145-
command_line += "G(" + mastering_display_sei_x1 + "," + mastering_display_sei_y1 + ")"
146-
command_line += "B(" + mastering_display_sei_x2 + "," + mastering_display_sei_y2 + ")"
147-
command_line += "R(" + mastering_display_sei_x3 + "," + mastering_display_sei_y3 + ")"
148-
command_line += "WP(" + mastering_display_sei_wx + "," + mastering_display_sei_wy + ")"
149-
command_line += "L(" + mastering_display_sei_max_lum + "," + mastering_display_sei_min_lum + "):"
40+
command_line += " -f rawvideo"
41+
if bit_depth == "8":
42+
command_line += " -pix_fmt yuv420p"
43+
else:
44+
command_line += " -pix_fmt yuv420p10le"
15045

151-
command_line += "aud=1:annexb=1:repeat-headers=1:hrd=1:hash=1:chromaloc=2:bitrate=" + data_rate + ":vbv-maxrate=" + max_vbv_data_rate + ":vbv-bufsize=" + vbv_buffer_size + "\""
152-
command_line += " -an"
153-
command_line += " -y"
154-
command_line += " -f hevc " + output_file
46+
command_line += " -vf scale=" + width + ":" + height + ":force_original_aspect_ratio=decrease,pad=" + width + ":" + height + ":\(ow-iw\)/2:\(oh-ih\)/2 "
47+
command_line += output_file
15548

15649
print(command_line)
157-

plugins/code/hevc_dec/ffmpeg/src/NamedPipe.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
/*
2+
* BSD 3-Clause License
3+
*
4+
* Copyright (c) 2017, Dolby Laboratories
5+
* All rights reserved.
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* * Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* * Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* * Neither the name of the copyright holder nor the names of its
18+
* contributors may be used to endorse or promote products derived from
19+
* this software without specific prior written permission.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
133
#include <thread>
234
#include <chrono>
335
#include "NamedPipe.h"

plugins/code/hevc_dec/ffmpeg/src/NamedPipe.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
/*
2+
* BSD 3-Clause License
3+
*
4+
* Copyright (c) 2017, Dolby Laboratories
5+
* All rights reserved.
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* * Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* * Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* * Neither the name of the copyright holder nor the names of its
18+
* contributors may be used to endorse or promote products derived from
19+
* this software without specific prior written permission.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
133
#ifdef WIN32
234

335
#include <windows.h>

0 commit comments

Comments
 (0)