コード例 #1
0
def main():

    parser = MCTF_parser(description="Info.")
    parser.add_argument("--GOPs",          help="number of GOPs to process. (Default = {})".format(info.GOPs))
    parser.add_argument("--TRLs",          help="number of iterations of the temporal transform + 1. (Default = {})".format(info.TRLs))
    parser.add_argument("--FPS",           help="frames per second. (Default = {})".format(info.FPS))

    args = parser.parse_known_args()[0]
    if args.GOPs:
        info.GOPs = int(args.GOPs)
    if args.TRLs:
        info.TRLs = int(args.TRLs)
    if args.FPS:
        info.FPS = int(args.FPS)


    x=info_j2k(info.GOPs, info.TRLs, info.FPS) #x=info_j2k() # ?
コード例 #2
0
ファイル: info_j2k.py プロジェクト: sergiocaceres/QSVC
def main():

    parser = MCTF_parser(description="Info.")
    parser.add_argument(
        "--GOPs",
        help="number of GOPs to process. (Default = {})".format(info.GOPs))
    parser.add_argument(
        "--TRLs",
        help="number of iterations of the temporal transform + 1. (Default = {})"
        .format(info.TRLs))
    parser.add_argument("--FPS",
                        help="frames per second. (Default = {})".format(
                            info.FPS))

    args = parser.parse_known_args()[0]
    if args.GOPs:
        info.GOPs = int(args.GOPs)
    if args.TRLs:
        info.TRLs = int(args.TRLs)
    if args.FPS:
        info.FPS = int(args.FPS)

    x = info_j2k(info.GOPs, info.TRLs, info.FPS)  #x=info_j2k() # ?
コード例 #3
0
## Size of the blocks in the motion estimation process.
block_size     = 32
## Minimal block size allowed in the motion estimation process.
block_size_min = 32
## Number of Group Of Pictures to process.
GOPs           = 1
## Number of Temporal Resolution Levels.
TRLs           = 4
## Controls the quality level and the bit-rate of the code-stream.
quantization   = 45000 # Jse
## Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream.
clayers        = "1"

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Compress the motion data.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.quantization(quantization)
parser.clayers(clayers)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
コード例 #4
0
ファイル: analyze_step.py プロジェクト: sergiocaceres/QSVC
block_overlaping = 0
## Size of a block.
block_size = 32
## Border size or margin of a block.
border_size = 0
## Total number of video images.
pictures = 9
## Search range for motion vectors.
search_range = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy = 0
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor = 0  # 1.0/4

## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(description="Performs a temporal analysis step.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.add_argument(
    "--temporal_subband",
    help="iteration of the temporal transform.".format(temporal_subband))
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.border_size(border_size)
parser.pictures(pictures)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.update_factor(update_factor)
コード例 #5
0
import sys
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

COMPONENTS = 4
BITS_COMPONENT = 16
BYTES_COMPONENT = 2

blocks_in_x = 0
blocks_in_y = 0
fields = 0
file = ""
discard_levels = 0

parser = MCTF_parser(description="Expands the motion data using JPEG 2000.")
#parser.add_argument("--discard_levels",
#                    help="number of discard level. (Default = {})".format(discard_levels))
parser.add_argument("--blocks_in_x",
                    help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",
                    help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",
                    help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--file",
                    help="name of the file with the motion fields. (Default = {})".format(file))

args = parser.parse_known_args()[0]
#if args.discard_levels:
#    discard_levels = int(args.discard_levels)
if args.blocks_in_x:
コード例 #6
0
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import sys
import math
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""
rate = 0.0
pictures = 33
pixels_in_x = 352
pixels_in_y = 288

parser = MCTF_parser(
    description="Expands the the HFB texture data using JPEG 2000.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument(
    "--rate",
    help=
    "read only the initial portion of the code-stream, corresponding to an overall bit-rate of \"rate\" bits/sample. Default = {})"
    .format(rate))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
コード例 #7
0
pixels_in_x          = 352
## Height of the pictures.
pixels_in_y          = 288
## Controls the quality level and the bit-rate of the code-stream.
quantization         = str((46000 + 42000) / 2) # "44000"
## Number of Temporal Resolution Levels.
TRLs                 = 4
## Number of Spatia Resolution Levels.
SRLs                 = 5
## File containing a distortion value per line. Each line corresponds
## to a frame of the sequence.
distortions           = ""

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Compress the texture.")
parser.GOPs(GOPs)
parser.nLayers(nLayers)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantization(quantization)
parser.quantization_step(quantization_step)
parser.TRLs(TRLs)
parser.SRLs(SRLs)
parser.distortions(distortions)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.GOPs:
    GOPs = int(args.GOPs)
コード例 #8
0
LOW = "low_"
## Refers to fields of motion.
MOTION = "motion_residue_"
## Indicates whether a log is recorded in a file.
print_file = False
## Number of Group Of Pictures to process.
GOPs = 1
## Number of Temporal Resolution Levels.
TRLs = 5
## Frames per second.
FPS = 30 # 30 # 50


## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Information of codestream.")
parser.GOPs(GOPs)
parser.FPS(FPS)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.GOPs :
    GOPs = int(args.GOPs)
if args.TRLs:
    TRLs = int(args.TRLs)
if args.FPS :
    FPS = int(args.FPS)


## Initializes the class GOP (Group Of Pictures).
コード例 #9
0
import display
import string
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser
HIGH = "high"
LOW = "low"

GOPs = 1
discarded_TRLs = 0
discarded_SRLs = 0
quantization = "45000"
TRLs = 6
GOPs = 1

parser = MCTF_parser(description="Transcodes a code-stream.")
parser.GOPs(GOPs)
parser.add_argument("--discarded_SRLs", help="number of discarded spatial resolution levels. Default = {}".format(discarded_parser.add_argument("--discarded_TRLs", help="number of discarded temporal resolution levels. Default = {}".format(discarded_TRLs))
SRLs))
parser.quantization(quantization)
parser.TRLs(TRLs)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.discarded_SRLs:
    discarded_SRLs = int(args.discarded_SRLs)
if args.discarded_TRLs:
    discarded_TRLs = int(args.discarded_TRLs)
if args.quantization:
    quantization = args.quantization
if args.SRLs:
コード例 #10
0
from MCTF_parser import MCTF_parser

block_overlaping = 0
block_size = 16
block_size_min = 16
border_size = 0
GOPs = 1
pixels_in_x = 352
pixels_in_y = 288
search_range = 4
subpixel_accuracy = 0
SRLs = 5
TRLs = 5
update_factor = 1.0 / 4

parser = MCTF_parser(description="Decodes a sequence of pictures.")
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.border_size(border_size)
parser.GOPs(GOPs)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.SRLs(TRLs)
parser.TRLs(TRLs)
parser.update_factor(update_factor)

args = parser.parse_known_args()[0]
if args.block_overlaping:
コード例 #11
0
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

MCTF_TEXTURE_CODEC = os.environ["MCTF_TEXTURE_CODEC"]
HIGH = "high"
LOW = "low"

GOPs = 1
pixels_in_x = 352
pixels_in_y = 288
quantizations = "45000"
TRLs = 5
SRLs = 5

parser = MCTF_parser(description="Compress the texture.")
parser.GOPs(GOPs)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantizations(quantizations)
parser.TRLs(TRLs)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.GOPs:
    GOPs = int(args.GOPs)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
    pixels_in_y = int(args.pixels_in_y)
if args.quantizations:
コード例 #12
0
from GOP import GOP
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

MCTF_TEXTURE_CODEC = os.environ["MCTF_TEXTURE_CODEC"]
LOW = "low"
HIGH = "high"

GOPs = 1
pixels_in_x = 352
pixels_in_y = 288
TRLs = 5
SRLs = 5

parser = MCTF_parser(description="Expands the texture.")
parser.GOPs(GOPs)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.SRLs(TRLs)
parser.TRLs(TRLs)

args = parser.parse_known_args()[0]
if args.GOPs:
    GOPs = int(args.GOPs)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
    pixels_in_y = int(args.pixels_in_y)
if args.SRLs:
    SRLs = int(args.SRLs)
コード例 #13
0
## Subpixel motion estimation order.
subpixel_accuracy    = 0
## Number of Temporal Resolution Levels.
TRLs                 = 4
## Number of Spatial Resolution Levels.
SRLs                 = 5
## Number of layers. Logarithm controls the quality level and the
#  bit-rate of the code-stream.
nLayers              = 5
## Weight of the update step.
update_factor        = 1.0/4


## The parser module provides an interface to Python's internal parser
#  and byte-code compiler.
parser = MCTF_parser(description="Encodes a sequence of pictures.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.border_size(border_size)
parser.GOPs(GOPs)
parser.clayers_motion(clayers_motion)
parser.quantization_step(quantization_step)
parser.quantization_motion(quantization_motion)
parser.quantization_texture(quantization_texture)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.TRLs(TRLs)
コード例 #14
0
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

#MOTION_DECODER_NAME = "gzip"
#MOTION_DECODER_NAME = "kdu_v_expand"
MCTF_MOTION_CODEC = os.environ["MCTF_MOTION_CODEC"]

block_size = 16
block_size_min = 16
GOPs = 1
pixels_in_x = 352
pixels_in_y = 288
TRLs = 5

parser = MCTF_parser(description="Expands the motion data.")
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.GOPs(GOPs)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.TRLs(TRLs)

args = parser.parse_known_args()[0]
if args.block_size:
    block_size = int(args.block_size)
if args.block_size_min:
    block_size_min = int(args.block_size_min)
if args.GOPs:
    GOPs = int(args.GOPs)
if args.pixels_in_x:
コード例 #15
0
## Logarithm controls the quality level and the bit-rate of the
#  code-stream used for the motion vectors. Used only 1 because we
#  have seen that compress motion information with loss, is not
#  helpful.
clayers      = 1
## Vector quantization. Normally does not apply, since the motion
#  information is compressed without loss.
quantization = 45000
## Number of Spatial Resolution Levels. Normally it does not apply,
#  since the vectors are usually compress and decompress at the same
#  spatial resolution.
SRLs         = 5

## The parser module provides an interface to Python's internal parser
#  and byte-code compiler.
parser = MCTF_parser(description="Compress the motion data using JPEG 2000.")
parser.add_argument("--blocks_in_x",   help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",   help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",        help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--quantization",  help="controls the quality level and the bit-rate of the code-stream. (Default = {})".format(quantization))
parser.add_argument("--clayers",       help="logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(clayers))
parser.add_argument("--file",          help="name of the file with the motion fields. (Default = {})".format(file))

## A script may only parse a few of the command-line arguments,
#  passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
コード例 #16
0
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import sys
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""

parser = MCTF_parser(description="Does nothing with the HFB texture data.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.file:
    file = args.file

try:
    check_call("trace cp " + file + " " + file + ".cp", shell=True)
except CalledProcessError:
    sys.exit(-1)
コード例 #17
0
ファイル: analyze.py プロジェクト: sergiocaceres/QSVC
block_size_min = 32
## Border size or margin of a block.
border_size = 0
## Number of Groups Of Pictures of the scene.
GOPs = 1
## Search range for motion vectors.
search_range = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy = 0
## Number of Temporal resolution Levels.
TRLs = 4
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor = 0  # 1.0/4

## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(
    description="Performs the temporal analysis of a picture sequence.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.border_size(border_size)
parser.GOPs(GOPs)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.TRLs(TRLs)
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments, passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
コード例 #18
0
# NOTA: Añadir código para que sea posible codificar todas las componentes juntas.

COMPONENTS = 3
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantization = 45000
subband = 4  # meterla en parametros !!!!!!!!!!!!!!!!!
SRLs = 5
nLayers = 5

parser = MCTF_parser(
    description="Compress the LFB texture data using JPEG 2000.")

parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument(
    "--nLayers",
    help=
    "Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})"
    .format(nLayers))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantization(quantization)
parser.SRLs(SRLs)
コード例 #19
0
## Size of the blocks in the motion estimation process.
block_size = 32
## Minimal block size allowed in the motion estimation process.
block_size_min = 32
## Number of Group Of Pictures to process.
GOPs = 1
## Number of Temporal Resolution Levels.
TRLs = 4
## Controls the quality level and the bit-rate of the code-stream.
quantization = 45000  # Jse
## Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream.
clayers = "1"

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Compress the motion data.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.quantization(quantization)
parser.clayers(clayers)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
コード例 #20
0
## File that contains the HFB data.
file = ""
## Number of images to process.
pictures = 33
## Width of the pictures.
pixels_in_x = 352
## Height of the pictures.
pixels_in_y = 288
## Controls the quality level and the bit-rate of the code-stream.
quantizations = 45000
## Number of Spatial Resolution Levels.
SRLs = 5

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(
    description="Compress the LFB texture data using Motion JPEG 2000.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantizations(quantizations)
parser.SRLs(SRLs)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.pictures:
コード例 #21
0
# -*- coding: iso-8859-15 -*-

import sys
import math
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""
rate = 0.0
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
subband = 4 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

parser = MCTF_parser(description="Expands the the LFB texture data using JPEG 2000.")
parser.add_argument("--file", help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument("--rate", help="read only the initial portion of the code-stream, corresponding to an overall bit-rate of \"rate\" bits/sample. Default = {})".format(rate))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.rate:
    rate = float(args.rate)
if args.pictures:
    pictures = int(args.pictures)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
コード例 #22
0
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

HIGH = "high_"
LOW = "low_"

discard_TRLs = 0
discard_SRLs_Tex = 0
discard_SRLs_Mot = 0
new_slope = 45000
GOPs = 1
TRLs = 6
List_Clayers = "11111"

parser = MCTF_parser(description="Transcode.")
parser.add_argument(
    "--discard_TRLs",
    help="number of discarded temporal resolution levels. (Default = {})".
    format(discard_TRLs))
parser.add_argument(
    "--discard_SRLs_Tex",
    help=
    "number of discarded spatial resolution levels for textures. (Default = {})"
    .format(discard_SRLs_Tex))
parser.add_argument(
    "--discard_SRLs_Mot",
    help=
    "number of discarded spatial resolution levels for motions. (Default = {})"
    .format(discard_SRLs_Mot))
parser.add_argument("--new_slope",
コード例 #23
0
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

COMPONENTS          = 4
BYTES_PER_COMPONENT = 2
BITS_PER_COMPONENT  = BYTES_PER_COMPONENT * 8

file         = ""
blocks_in_x  = 0
blocks_in_y  = 0
fields       = 0
clayers      = 1
quantization = 45000
SRLs         = 5

parser = MCTF_parser(description="Compress the motion data using JPEG 2000.")
parser.add_argument("--blocks_in_x",   help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",   help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",        help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--quantization",  help="controls the quality level and the bit-rate of the code-stream. (Default = {})".format(quantization))
parser.add_argument("--clayers",       help="logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(clayers))
parser.add_argument("--file",          help="name of the file with the motion fields. (Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
    fields = int(args.fields)
if args.clayers:
コード例 #24
0
# NOTA: Añadir código para que sea posible codificar todas las componentes juntas.

COMPONENTS = 3
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantization = 45000
subband = 4 # meterla en parametros !!!!!!!!!!!!!!!!!
SRLs = 5
nLayers = 5

parser = MCTF_parser(description="Compress the LFB texture data using JPEG 2000.")

parser.add_argument("--file", 
                    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument("--nLayers",
                    help="Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(nLayers))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantization(quantization)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.nLayers:
コード例 #25
0
HIGH = "high_"
LOW = "low_"
COMPONENTS = 4

discard_TRLs=0
discard_SRLs_Tex=0
discard_SRLs_Mot=0
new_slope = 45000
GOPs = 1
TRLs = 3
SRLs = 5
FPS = 30
BRC = 99999999

parser = MCTF_parser(description="Transcode.")
parser.add_argument("--discard_TRLs",
                    help="number of discarded temporal resolution levels. (Default = {})".format(discard_TRLs))
parser.add_argument("--discard_SRLs_Tex",
                    help="number of discarded spatial resolution levels for textures. (Default = {})".format(discard_SRLs_Tex))
parser.add_argument("--discard_SRLs_Mot",
                    help="number of discarded spatial resolution levels for motions. (Default = {})".format(discard_SRLs_Mot))
parser.add_argument("--new_slope",
                    help="new slope. (Default = {})".format(new_slope))
parser.add_argument("--GOPs",
                    help="number of GOPs to process. (Default = {})".format(GOPs))
parser.add_argument("--TRLs",
                    help="number of iterations of the temporal transform + 1. (Default = {})".format(TRLs))
parser.add_argument("--BRC",
                    help="bit-rate control (kbps). (Default = {})".format(BRC))
コード例 #26
0
#  - Multiplexing components (Y, U y V).

import sys
import os
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

## File that contains the HFB data.
file = ""
## Number of images to process.
pictures = 33

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Expands the the HFB texture data using LTW.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.pictures(pictures)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.pictures:
    pictures = int(args.pictures)

# Decode and multiplexing all components (YUV).
#----------------------------------------------
コード例 #27
0
## Number of bits of each component.
BITS_COMPONENT  = BYTES_COMPONENT * 8
## Number of blocks in the X direction.
blocks_in_x = 0
## Number of blocks in the Y direction.
blocks_in_y = 0
## Number of pictures of a temporal resolution.
fields      = 0
## Name of the file with the motion fields.
file        = ""
# Number of discard level.
# discard_levels = 0

## The parser module provides an interface to Python's internal parser
#  and byte-code compiler.
parser = MCTF_parser(description="Expands the motion data using JPEG 2000.")
#parser.add_argument("--discard_levels", help="number of discard level. (Default = {})".format(discard_levels))
parser.add_argument("--blocks_in_x",     help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",     help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",          help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--file",            help="name of the file with the motion fields. (Default = {})".format(file))

## A script may only parse a few of the command-line arguments,
#  passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
#if args.discard_levels:
#    discard_levels = int(args.discard_levels)
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
コード例 #28
0
ファイル: analyze.py プロジェクト: vicente-gonzalez-ruiz/QSVC
block_size_min    = 32
## Border size or margin of a block.
border_size       = 0
## Number of Groups Of Pictures of the scene.
GOPs              = 1
## Search range for motion vectors.
search_range      = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy = 0
## Number of Temporal resolution Levels.
TRLs              = 4
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor     = 0 # 1.0/4

## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(description="Performs the temporal analysis of a picture sequence.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.border_size(border_size)
parser.GOPs(GOPs)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.TRLs(TRLs)
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments, passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
コード例 #29
0
TRLs = 4
## Number of Spatia Resolution Levels.
SRLs = 5
## Optional and developing parameter indicates whether to extract the
#  codestream to a given bit-rate. The bit-rate control is performed
#  in transcode.py, a detailed manner, and therefore its use is
#  recommended for this purpose.
rates = "0.0,0.0,0.0,0.0,0.0"
## Width of the pictures.
pixels_in_x = "352,352,352,352,352"
## Height of the pictures.
pixels_in_y = "288,288,288,288,288"

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Expands the texture.")
parser.GOPs(GOPs)
parser.SRLs(SRLs)
parser.TRLs(TRLs)
parser.rates(rates)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.GOPs:
    GOPs = int(args.GOPs)
if args.SRLs:
    SRLs = int(args.SRLs)
if args.TRLs:
コード例 #30
0
import display
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

COMPONENTS = 3
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantizations = 45000
SRLs = 5

parser = MCTF_parser(description="Compress the LFB texture data using Motion JPEG 2000.")

parser.add_argument("--file", help="file that contains the LFB data. Default = {})".format(file))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantizations(quantizations)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.pictures:
    pictures = int(args.pictures)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
コード例 #31
0
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

#MOTION_CODER_NAME = "gzip"
#MOTION_CODER_NAME = "kdu_v_compress"
MCTF_MOTION_CODEC = os.environ["MCTF_MOTION_CODEC"]

block_size = 16
block_size_min = 16
GOPs = 1
pixels_in_x = 352
pixels_in_y = 288
TRLs = 5

parser = MCTF_parser(description="Compress the motion data.")
parser.block_size(block_size)
parser.block_size_min(block_size_min)
parser.GOPs(GOPs)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.TRLs(TRLs)

args = parser.parse_known_args()[0]
if args.block_size:
    block_size = int(args.block_size)
if args.block_size_min:
    block_size_min = int(args.block_size_min)
if args.GOPs:
    GOPs = int(args.GOPs)
if args.pixels_in_x:
コード例 #32
0
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import sys
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""

parser = MCTF_parser(description="Does nothing with the HFB texture data.")
parser.add_argument("--file", help="file that contains the LFB data. Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.file:
    file = args.file

try:
    check_call("trace cp " + file + ".cp " + file, shell=True)
except CalledProcessError:
    sys.exit(-1)
コード例 #33
0
## Size of a block.
block_size          = 32
## Border size or margin of a block.
border_size         = 0
## Total number of video images.
pictures            = 9
## Search range for motion vectors.
search_range        = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy   = 0
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor       = 0 # 1.0/4


## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(description="Performs a temporal analysis step.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.add_argument("--temporal_subband", help="iteration of the temporal transform.".format(temporal_subband))
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.border_size(border_size)
parser.pictures(pictures)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments, passing the remaining arguments on to another script or program.
コード例 #34
0
ファイル: info_mc_j2k.py プロジェクト: sergiocaceres/QSVC
## Refers to low frequency subbands.
LOW = "low_"
## Refers to fields of motion.
MOTION = "motion_residue_"
## Indicates whether a log is recorded in a file.
print_file = False
## Number of Group Of Pictures to process.
GOPs = 1
## Number of Temporal Resolution Levels.
TRLs = 5
## Frames per second.
FPS = 30  # 30 # 50

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Information of codestream.")
parser.GOPs(GOPs)
parser.FPS(FPS)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.GOPs:
    GOPs = int(args.GOPs)
if args.TRLs:
    TRLs = int(args.TRLs)
if args.FPS:
    FPS = int(args.FPS)

## Initializes the class GOP (Group Of Pictures).
gop = GOP()
コード例 #35
0
pixels_in_x = 352
## Height of the pictures.
pixels_in_y = 288
## Size of the search areas in the motion estimation process.
search_range = 4
## Subpixel motion estimation order.
subpixel_accuracy = 0
## Number of subband. Refers to the interaction of the temporal
## transform.
temporal_subband = 0
## Weight of the update step.
update_factor = 1.0 / 4

## The parser module provides an interface to Python's internal parser
## and byte-code compiler.
parser = MCTF_parser(description="Performs a step of the temporal synthesis.")
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.add_argument(
    "--temporal_subband",
    help="iteration of the temporal transform. Default = {}".format(
        temporal_subband))
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments,
## passing the remaining arguments on to another script or program.