Skip to content

Commit

Permalink
Refactor UHD and 1080i_fake profiles into 2160p and 1080p.
Browse files Browse the repository at this point in the history
  • Loading branch information
rofafor committed Mar 14, 2018
1 parent a85cfdb commit 6037a1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
4 changes: 1 addition & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ Setup: /etc/vdr/setup.conf
vaapidevice.Osd.Height = 0
0 = auto (=display, unscaled) n = fixed osd size scaled for display

<res> of the next parameters is 576i, 720p, 1080i_fake, 1080i, or UHD.
1080i_fake is 1280x1080 or 1440x1080
1080i is "real" 1920x1080
<res> of the next parameters is 576i, 720p, 1080i, 1080p, or 2160p.

vaapidevice.<res>.Scaling = 0
0 = normal, 1 = fast, 2 = HQ, 3 = anamorphic
Expand Down
4 changes: 2 additions & 2 deletions vaapidevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static class cVaapiDevice *MyDevice;

/// resolutions names
static const char *const Resolution[RESOLUTIONS] = {
"576i", "720p", "1080i_fake", "1080i", "UHD"
"576i", "720p", "1080i", "1080p", "2160p"
};

static char ConfigMakePrimary; ///< config primary wanted
Expand Down Expand Up @@ -814,7 +814,7 @@ void cMenuSetupSoft::Create(void)
"None", "PCM", "AC-3", "PCM + AC-3"
};
static const char *const resolution[RESOLUTIONS] = {
"576i", "720p", "fake 1080i", "1080i", "UHD"
"576i", "720p", "1080i", "1080p", "2160p"
};
int current;
const char **scaling;
Expand Down
28 changes: 10 additions & 18 deletions video.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ typedef enum _video_resolutions_
{
VideoResolution576i, ///< ...x576 interlaced
VideoResolution720p, ///< ...x720 progressive
VideoResolutionFake1080i, ///< 1280x1080 1440x1080 interlaced
VideoResolution1080i, ///< 1920x1080 interlaced
VideoResolutionUHD, ///< UHD progressive
VideoResolution1080i, ///< ...x1080 interlaced
VideoResolution1080p, ///< ...x1080 progressive
VideoResolution2160p, ///< ...x2160 progressive
VideoResolutionMax ///< number of resolution indexs
} VideoResolutions;

Expand Down Expand Up @@ -529,26 +529,18 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width, in
/// @param height video picture raw height
/// @param interlace flag interlaced video picture
///
/// @note interlace isn't used yet and probably wrong set by caller.
///
static VideoResolutions VideoResolutionGroup(int width, int height, __attribute__ ((unused))
int interlace)
static VideoResolutions VideoResolutionGroup(int width, int height, int interlace)
{
if (height == 2160) {
return VideoResolutionUHD;
}
if (height <= 576) {
return VideoResolution576i;
}
if (height <= 720) {
} else if (height <= 720) {
return VideoResolution720p;
} else if (height <= 1080) {
return interlace ? VideoResolution1080i : VideoResolution1080p;
} else if (height <= 2160) {
return VideoResolution2160p;
}
if (height < 1080) {
return VideoResolutionFake1080i;
}
if (width < 1920) {
return VideoResolutionFake1080i;
}

return VideoResolution1080i;
}

Expand Down

0 comments on commit 6037a1a

Please sign in to comment.