Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BetterCapture/Model/SettingsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
var h264BitsPerPixel: Double {
switch self {
case .low: 0.04
case .medium: 0.15
case .medium: 0.2
case .high: 0.6
}
}
Expand All @@ -200,7 +200,7 @@
var hevcBitsPerPixel: Double {
switch self {
case .low: 0.02
case .medium: 0.1
case .medium: 0.15
case .high: 0.4
}
}
Expand Down Expand Up @@ -237,7 +237,7 @@
/// Persists user preferences using UserDefaults
@MainActor
@Observable
final class SettingsStore {

Check warning on line 240 in BetterCapture/Model/SettingsStore.swift

View workflow job for this annotation

GitHub Actions / Lint

Class body should span 300 lines or less excluding comments and whitespace: currently spans 395 lines (type_body_length)

// MARK: - Dependencies

Expand Down Expand Up @@ -745,4 +745,4 @@
func generateOutputURL() -> URL {
outputDirectory.appending(path: generateFilename())
}
}

Check warning on line 748 in BetterCapture/Model/SettingsStore.swift

View workflow job for this annotation

GitHub Actions / Lint

File should contain 500 lines or less: currently contains 748 (file_length)
8 changes: 4 additions & 4 deletions BetterCaptureTests/VideoQualityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ struct VideoQualityTests {

@Test func h264BitsPerPixel() {
#expect(VideoQuality.low.h264BitsPerPixel == 0.04)
#expect(VideoQuality.medium.h264BitsPerPixel == 0.15)
#expect(VideoQuality.medium.h264BitsPerPixel == 0.2)
#expect(VideoQuality.high.h264BitsPerPixel == 0.6)
}

// MARK: - hevcBitsPerPixel

@Test func hevcBitsPerPixel() {
#expect(VideoQuality.low.hevcBitsPerPixel == 0.02)
#expect(VideoQuality.medium.hevcBitsPerPixel == 0.1)
#expect(VideoQuality.medium.hevcBitsPerPixel == 0.15)
#expect(VideoQuality.high.hevcBitsPerPixel == 0.4)
}

// MARK: - bitsPerPixel(for:)

@Test func bitsPerPixelForH264() {
#expect(VideoQuality.low.bitsPerPixel(for: .h264) == 0.04)
#expect(VideoQuality.medium.bitsPerPixel(for: .h264) == 0.15)
#expect(VideoQuality.medium.bitsPerPixel(for: .h264) == 0.2)
#expect(VideoQuality.high.bitsPerPixel(for: .h264) == 0.6)
}

@Test func bitsPerPixelForHEVC() {
#expect(VideoQuality.low.bitsPerPixel(for: .hevc) == 0.02)
#expect(VideoQuality.medium.bitsPerPixel(for: .hevc) == 0.1)
#expect(VideoQuality.medium.bitsPerPixel(for: .hevc) == 0.15)
#expect(VideoQuality.high.bitsPerPixel(for: .hevc) == 0.4)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/OUTPUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bitrate = width * height * bitsPerPixel * frameRate
| Quality | H.264 bpp | HEVC bpp |
| ------- | --------- | -------- |
| Low | 0.04 | 0.02 |
| Medium | 0.15 | 0.10 |
| Medium | 0.20 | 0.15 |
| High | 0.60 | 0.40 |

HEVC uses lower bpp values because it achieves comparable visual quality at roughly half the bitrate of H.264.
Expand Down
Loading