What is YUVrecon video produced by HEVC encoder? - hevc

What is YUVrecon video file produced by HEVC encoder along with .HEVC file at the end?
Someone told me:
HEVC file is produced by HEVC encoder.
HEVC decoder is also working and YUV recon is decoded result of .HEVC file.
And another friend told me:
YUV recon is just for debugging purposes. It is not decoded result of .HEVC file produced by encoder. So, we cannot use this YUVrecon video file to check the compression ratios, bitrate and other results.
Any help?

The YUV file is the result of HEVC encoder, you want to check the performance like bitrate, compression ratio. You need orignal YUV file(The input of HEVC encoder). so, just use bitstream file cannot check performance of HEVC encoder.

I agree with your "another friend"! It is mostly used for debugging and is not necessarily what you would have if you decoded your bitstream.
For example, if you make a change to the encoder that breaks something internally, then you would have a mismatch between the encoder-side and the decoder-side reconstructed YUV file. Personally, I use this comparison to find the starting point (pixel or CU) of a bug.
Regarding your other question, I don't understand how one can use a YUV file for rate comparison. Basically, YUV files are uncompressed and do not carry any information about the compression rate. What you need for compression ratio analysis, is the compressed bitstream, not the reconstructed YUV file.

Related

How to convert a pdf with Ghostscript so the images will be encoded in CCITT

I'm trying to reduce the size of a pdf file by converting its images from color/gray to B/W and re-encode those images using the more efficient CCITT Group 4 or JBIG2 encoding.
Can it be done via Ghostscript? How?
If not, is there another CLI tool that can help?
Yes Ghostscript can be used many ways with MonoChrome Group 4 compression. Halftone/Dithered will be needed for GreyTones.
CCITT g4 is a highly efficient Monochrome FaX scanner / printer format, its GhostScript device output is available as:-
-sDEVICE=faxg4 and also can be used inside a multi page tiff -sDEVICE=tiffg4 or also as individual pages via -sDEVICE=tiffsep1
it can also be specified using -sCompression=g4
see https://ghostscript.com/doc/current/Devices.htm#fax
and https://ghostscript.com/doc/current/Devices.htm#TIFF
Ghostscript JBIG2 support is uni-directional as they provide a DeCoder library for decoding JBIG2 streams in PDF files. Thus its primary focus is the set of JBIG2 features supported in PDF. So it is used in decoding for PDL outputs but not as a compression DEVICE.
I have been looking for relevant information today, which brings me here. I think the JBIG2 encoder is not free, and Ghostscript doesn't provide that. On the other hand, for Ghostscript, CCITTFax encoder is just the default one for monochrome images.
Ghostscript, jbig2dec
Ghostscript, High Level Output Devices

Converting an executable file into an analog waveform signal

I have been trying to convert a digital binary file (.exe) into waveform to listen the resulted audio. I have been looking for any possible software/open source code to help me in achieving this, but no use.
My ultimate goal is to represent the .exe file as a spectogram to analyse the behaviour of the frequencies in the executable file. My understanding that I have to identify the range of frequencies first, which could be done by plotting the waveform first.
Any reference would be appreciated.
Edit:
I have a collection of binary files and I need to classify them according to their sound statistical features (frequency behaviour). My plan was to get the waveform of the actual binary file (by dividing the file into 1 signed byte each) and then convert the waveform into spectrogram picture and apply deep learning analysis for voice recognition
So, the depth of each sample will be 8-bits, and the sampling rate will be either 8Khz or 16 Khz. But I am confused of how to determine the frequencies related from the executable file

extracting motion-compensated frames during HEVC encoding

I am trying to analyze H.265 coding performance. Is there a way to export the predicted frames for H.265/HEVC encoding? Specifically, how should I obtain reconstructed frames after compensating with the motion vectors, but before applying the residual? Is there a way to do this with ffmpeg, or any other codec analysis tool?
Yes you can do it with HM decoder.
What you need to do is to find the exact line of the code in the TDecCu.cpp file, where two pointers piResi and piPred are accessed to be added and reconstruct the block. There, you may print piPred alone.

Reading compressed image data from PNG using libpng

How can I read the compressed image data from the IDAT chunk of a PNG using libpng? I have not found a method to do this in the libpng documentation, but I may have overlooked it. Is it somehow possible to use the "unknown chunk" facility for the IDAT chunk?
The purpose of this is that I want to write a very fast PNG-to-PDF converter. Because PDF supports the PNG data format (with each scanline prefixed by a filter-type byte), it should be possible to just copy over the contents of the (concatenated) IDAT chunks and slap the right PDF headers around it (also copying the palette if necessary). This saves a decompression/re-compression step.
If libpng does not provide such low-level access, does any other library provide this functionality? Otherwise I'll just write a PNG chunk reader myself...

How to convert scanned document images to a PDF document with high compression?

I need to convert scanned document images to a PDF document with high compression. Compression ratio is very important. Can someone recommend any solution on C# for this task?
Best regards, Alexander
There is a free program called PDFBeads that can do it. It requires Ruby, ImageMagick and optionally jbig2enc.
The PDF format itself will probably add next to no overhead in your case. I mean your images will account for most of the output file size.
So, you should compress your images with highest possible compression. For black-and-white images you might get smallest output using FAX4 or JBIG2 compression schemes (both supported in PDF files).
For other images (grayscale, color) either use smallest possible size, lowest resolution and quality, or convert images to black-and-white and use FAX4/JBIG2 compression scheme.
Please note, that most probably you will lose some detail of any image while converting to black-and-white.
If you are looking for a library that can help you with recompression then have a look at Docotic.Pdf library (Disclaimer: I am one of developers of the library).
The Optimize images sample code shows how to recompress images before adding them to PDF. The sample shows how to recompress with JPEG, but for FAX4 the code will be almost the same.