summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
Commit message (Collapse)AuthorAgeFilesLines
* scan: fix very slow scanning for some filesJohn Stebbins2017-04-121-0/+1
| | | | | | | The threshold in bytes for when to give up trying to decode a frame was too big for a lot of streams. It was made large to accomodate 4K raw video. Instead of counting bytes, count frames fed to the decoder. This is more consistant regardless of video resolution and codec.
* Fix raw video timestampsJohn Stebbins2017-04-091-0/+2
| | | | | | Raw video has no timestamps. But we drop frames in sync that have no timestamps. So detect raw video and extrapolate timestamps from framerate.
* subtitles: simplify and shorten subtitle descriptions (#591)John Stebbins2017-03-101-13/+22
| | | | | | | | | | | | | | | | | | * subtitles: simplify and shorten subtitle descriptions Generally, it eliminates parens to make things more readable. I.e. it turns this: English (Closed Caption)(Wide Screen)(Bitmap)(VOBSUB) Into this: English, Closed Caption [Wide Screen, VOBSUB] * Revise punctuation per BradleyS request * fix subtitle description formatting * incorporate suggestions from PR
* qsv: adding hevc decode supportmaxd2017-03-041-0/+8
|
* decavcodec: drop initial_padding audio samplesJohn Stebbins2017-02-211-12/+51
| | | | | | These are samples that were not in the original source and were added by the encoder. To get a faithful reproduction of the source, they must be dropped.
* decavcodec: fix commentJohn Stebbins2017-02-181-1/+1
|
* decavcodec: fix avcodec_open failure upon bad extradataJohn Stebbins2017-01-241-2/+6
| | | | | | | If extradata is improperly parsed, avcodec_open may fail. Keep trying avcodec_open as long as there is more data to parse. Fixes https://github.com/HandBrake/HandBrake/issues/542
* decavcodec: fix crash in decavcodecvInfoJohn Stebbins2017-01-241-1/+1
| | | | | If avcodec_open fails, pv->context->codec is NULL, but work->info may still be called by scan.
* qsv: fix for memory leak for decodemaxd2017-01-031-1/+1
| | | | Closes #490.
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* libhb: pass through BT.2020 transfer flagsJohn Stebbins2016-12-221-0/+4
|
* libhb: add new color tags for Bt 2020 and SMPTE ST 2084Damiano Galassi2016-12-211-0/+8
|
* unref AVPackets, fix merge issuesJohn Stebbins2016-12-171-1/+6
|
* qsv: rename av_qsv* to hb_qsv*John Stebbins2016-12-171-1/+1
|
* decavcodec: fix use of deprecated libav interfacesJohn Stebbins2016-12-171-164/+222
| | | | | | | avcodec_decode_audio4 is deprecated, use avcodec_send_packet and avcodec_receive_frame av_bitstream_filter is deprecated, use av_bsf
* qsv: Update condition under which context is closed.Tim Walker2016-12-171-2/+6
|
* decavcodec: enable QSV-accelerated H.264 decoding with libavcodec.Tim Walker2016-12-171-26/+33
| | | | | | Videos get decoded to NV12 in system memory and converted to our internal colorspace via libswscale. It should be noted that QSV- accelerated decoding now works with all our videos encoders :-)
* libhb: fix small leaksJohn Stebbins2016-12-141-2/+6
| | | | fixes various context leaks in error conditions
* Select the appropriate coefficients for yuv<->rgb conversions.Damiano Galassi2016-11-081-61/+74
|
* libhb: rename some masks to better reflect their purpose.Tim Walker2016-09-171-1/+1
|
* libhb: use the new keyframe flag.Tim Walker2016-09-171-4/+10
|
* sync: correct timestamp discontinuities in sync instead of reader (#192)John Stebbins2016-05-241-398/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sync: correct timestamp discontinuities in sync instead of reader This patch passes discontinuity information through the pipeline till it reaches sync.c. The timestamps are passed through the pipeline as read and unmodified to sync.c (instead of attempting to correct discontinuities in reader). In sync, when we see a discontinuity, we know where the next timestamp should be based on the timestamp and duration of the previous buffer (before the discontinuity). So we calculate an "SCR" offset based on the timestamp after the discontinuity and what we calculate it should be. The old discontinuity handling code was broken due to the following. The MPEG STD timing model relies heavily on the decoder having an STC that is phase lock looped to the PCRs in the stream. When decoding a broadcast stream, the decoder can count on the time measure between PCRs using the STC to match to a high degree of accuracy. I.e. STC - lastSTC == PCR - lastPCR. When a discontinuity occurs, the decoder calculates a new PCR offset = PCR - STC. I.e. the offset is the new PCR value minus what it would have been if there had been no discontinuity. The above does not work without a reliable STC, which we do not have. We have been attempting to approximate one by avereraging the duration of received packets and extrapolating an "STC" based on the last PTS and the average packet duration. But this is highly variable and unreliable. * decavcodec: fix data type of next_pts It needs to be double so that partial ticks are not lost * deccc608sub: clarify comment * sync: allow queueing more audio Audio is small, and there is often a significant amount of audio in the stream before the first video frame. * sync: improve handling of damaged streams When data is missing, the audio decoder was extrapolating timestamps from the last pts before the error caused by the missing data which caused sync issues. Also, missing data can cause the video decoder to output a frame out of order with the wrong scr sequence. Drop such frames.
* sync: move chapter logging to sync.cJohn Stebbins2016-05-171-22/+0
|
* move cadence (Film->Video) logging to sync.cJohn Stebbins2016-05-171-91/+0
|
* libhb: remove unused hb_buffer_t sequence numberJohn Stebbins2016-05-171-10/+8
|
* decavcodec: remove unused frame_duration_setJohn Stebbins2016-05-171-5/+0
|
* decavcodec: cosmeticsJohn Stebbins2016-05-171-5/+5
|
* libhb: send initial chapter through pipelineJohn Stebbins2016-05-171-8/+0
| | | | | Eliminate the need for everyone to assume that the first chapter starts at the first frame.
* remove dxva hw decode (#189)John Stebbins2016-05-171-203/+48
| | | | | | | | | * remove dxva hw decode It provides practically no speed increase even on a slow CPU and results in a speed decrease on fast CPUs. And the code is exceptionally fugly. * cli: remove USE_HWD
* decavcodec: fix audio decoder frame countJohn Stebbins2016-04-211-0/+5
| | | | it was always 0
* decavcodec: cosmeticsJohn Stebbins2016-03-231-9/+19
|
* decavcodec: recompute frame duration for every frameJohn Stebbins2016-02-281-2/+3
| | | | It can change mid-stream
* sync: gut and rewriteJohn Stebbins2016-01-211-0/+1
| | | | | | | | | | | sync.c was difficult to read, fragile, and prone to difficult to diagnose bugs (see https://forum.handbrake.fr/viewtopic.php?f=12&t=33147) This rewrite simplifies the code, removes signals, locking and yield that probably cause the above problem and is much more flexible. It fixes a wider variety of timestamp issues than before and is much easier to extend if other timestamp analysis is desired.
* Update copyright dates to 2016.Bradley Sepos2016-01-011-1/+1
|
* libhb: use LL for int64 constants to make mingw happyJohn Stebbins2015-12-261-7/+7
|
* decavcodec: don't try to memset NULL buffersJohn Stebbins2015-11-061-2/+8
|
* decavcodec: fix hang in avcodec decoderJohn Stebbins2015-11-061-0/+10
| | | | | libavcodec/mpeg12dec.c expects input buffers to be zero padded to 32 bit alignment. If not zero padded, it can get caught in an infinite loop.
* libhb: don't use deprecated AVPictureJohn Stebbins2015-10-291-4/+4
| | | | | libav just deprecated AVPicture and all av_picture_*/avpicture_* functions.
* libhb: add hb_buffer_listJohn Stebbins2015-09-241-84/+53
| | | | | This brings together several independent implementations of a simple buffer list manager.
* libhb: Clock/frame rate handling improvements.Bradley Sepos2015-09-101-2/+5
| | | | | | | | Allows for arbitrary frame rates between 1 and 1000 fps. Adds min/max frame rates to CLI help. Removes hardcoded instances of the internal clock rate in favor of hb_video_framerate_get_limits(). Unfortunately, much of the codebase generally refers to clock rate as frame rate, so a little extra care is still necessary going forward.
* DXVA2: cleanup decode support checks.Rodeo2015-06-231-2/+16
| | | | | | | This should fix https://forum.handbrake.fr/viewtopic.php?f=11&t=32520 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7310 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Use a buffer flat to indicate EOFjstebbins2015-05-011-6/+6
| | | | | | | | | | | | ... instead of a 0 length buffer. This fixes this issue: https://forum.handbrake.fr/viewtopic.php?f=12&t=31959 Theora can create 0 length output. These 0 length frames indicate duplicate frames. So we can't use 0 length buffers to indicate the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Eliminate global variable hb_gui_use_hwd_flagjstebbins2015-03-291-1/+1
| | | | | | | | | | | | This global was shared between the CLI and libhb and used as a back door to force scan and encode passes to use the same ffmpeg context for hardware decoding. Aside from the fact that this context sharing should not be necessary and needs fixing, this information belongs in the hb_handle_t that is shared between the scan and the encode. So put it there and make sure the hb_handle_t get propagated to where the flag is needed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New audio output options.Rodeo2015-02-151-12/+11
| | | | | | | | | Dolby Digital Plus (E-AC-3), Dolby TrueHD and FLAC can now be passed through without re-encoding. They aren't covered by Auto Passthru yet, however. In addition, encoding to E-AC-3 is now possible. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Fix AAC passthru from TS filesjstebbins2015-02-041-1/+29
| | | | | | | | | | Apply aac_adtstoasc bitstream filter while muxing AAC stream and extract AudioSpecificConfig during scan. Patch submitted by Taihei Momma git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6867 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update year to 2015.bradleys2015-02-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: fix building with --enable-hwdjstebbins2014-12-181-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6607 b64f7644-9d1e-0410-96f1-a4d463321fa5
* json: add json APIsjstebbins2014-12-161-21/+21
| | | | | | | | | | There are several changes to job and title structs that break current windows interop code. The interop code should be changed such that it only uses json APIs. So if there is any missing features (or bugs) in these APIs, please let me know. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: enable crc checking of audio streams during audio parameter probejstebbins2014-11-051-2/+7
| | | | | | | | | We used to check ac3 crc's when we used a52 dec. When we switched to libav we did not enable crc checks. I suspect this is the root cause of this problem https://forum.handbrake.fr/viewtopic.php?f=12&t=31032 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6507 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decavcodec: fix a 4 byte overread of extradata by libavjstebbins2014-10-291-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6480 b64f7644-9d1e-0410-96f1-a4d463321fa5