Skip to content

Commit

Permalink
Merge branch 'vhs_decode' of github.com:oyvindln/vhs-decode into vhs_…
Browse files Browse the repository at this point in the history
…decode
  • Loading branch information
oyvindln committed Jan 7, 2025
2 parents 306d4a0 + 8c069b7 commit 58ac9d1
Show file tree
Hide file tree
Showing 6 changed files with 504 additions and 340 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ option(USE_QWT
# Needed for ezpwd as it uses alternative operators
if(MSVC)
add_compile_options(/permissive-)
else()
add_compile_options(-O3)
add_link_options(-O3)
endif()

set(USE_QT_VERSION "" CACHE STRING
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
![vhs-decode logo](docs/vhs-decode_logo_256px.png)
<img src="assets/icons/Cross-Platform-VHS-Decode-Trasparent.png" width="300" height="">


# VHS-Decode (It does more than VHS now!)


A fork of [LD-Decode](https://github.com/happycube/ld-decode), the decoding software powering the [Domesday86 Project](https://www.domesday86.com/).
This version has been modified to work with the differences found in the tracked RF drum head signals taken directly from colour-under & FM modulated composite videotape formats.

This version has been modified to work with the differences found in FM RF signals taken directly from colour-under & composite FM modulated videotape formats, captured directly from the heads pre-amplification & tracking stage before any internal video/hifi processing.

------

> [!CAUTION]
> Not to be confused with the TV Modulator/Demodulator pack or the **"antenna connectors"** on the back of the VCR!
> FM RF Archival captures and capturing is not to be confused with the TV Modulator/Demodulator pack's signals i.g the **"antenna connectors"** on the back of a VCR!
<img src="assets/images/DdD-EBU-Colour-Bar-PAL-VHS-SP.png" width="" height="">

Expand Down Expand Up @@ -334,7 +337,7 @@ Compile and Install ld-tools suite: (Required)

mkdir build2
cd build2
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT_VERSION=5
CXXFLAGS="-march=native" CFLAGS="-march=native" cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT_VERSION=5
make -j4
sudo make install

Expand Down
9 changes: 1 addition & 8 deletions cvbsdecode/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,9 @@ def compute_linelocs(self):
)
# Make sore to not move backwards here
return None, None, max(line0loc - (meanlinelen * 20), self.inlinelen)

validpulses_arr = np.sort(np.asarray(
[
p[1].start
for p in validpulses
], dtype=np.int32
))

linelocs, lineloc_errs, last_validpulse = sync.valid_pulses_to_linelocs(
validpulses_arr,
validpulses,
line0loc,
0,
meanlinelen,
Expand Down
40 changes: 39 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
from setuptools import setup
import distutils.ccompiler
from distutils.extension import Extension
from Cython.Build import cythonize

# Uncomment to view C code generated from Cython files
# import Cython.Compiler.Options
# Cython.Compiler.Options.annotate = True

import numpy

compiler = distutils.ccompiler.new_compiler()

if compiler.compiler_type == "unix":
extra_compile_args=["-O3", "-flto"]
extra_link_args=["-O3", "-flto"]
else:
extra_compile_args=[]
extra_link_args=[]

setup(
# name='ld-decode',
# version='7',
Expand Down Expand Up @@ -41,7 +57,29 @@
# 'cvbs-decode',
# 'hifi-decode',
# ],
ext_modules=cythonize(["vhsdecode/*.pyx"], language_level=3),
ext_modules=cythonize([
Extension(
"vhsdecode.sync",
["vhsdecode/sync.pyx"],
language_level=3,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
"vhsdecode.hilbert",
["vhsdecode/hilbert.pyx"],
language_level=3,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
Extension(
"vhsdecode.linear_filter",
["vhsdecode/linear_filter.pyx"],
language_level=3,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
)
]),
# Needed for using numpy in cython.
include_dirs=[numpy.get_include()],
# These are just the minimal runtime dependencies for the Python scripts --
Expand Down
9 changes: 1 addition & 8 deletions vhsdecode/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,16 +685,9 @@ def compute_linelocs(self):
)
ldd.logger.info("lastline < proclines , skipping a tiny bit")
return None, None, max(line0loc - (meanlinelen * 20), self.inlinelen)

validpulses_arr = np.sort(np.asarray(
[
p[1].start
for p in validpulses
], dtype=np.int32
))

linelocs, lineloc_errs, last_validpulse = sync.valid_pulses_to_linelocs(
validpulses_arr,
validpulses,
first_hsync_loc,
first_hsync_loc_line,
meanlinelen,
Expand Down
Loading

0 comments on commit 58ac9d1

Please sign in to comment.