summaryrefslogtreecommitdiffstats
path: root/libavfilter/af_hdcd.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2016-07-23 21:26:49 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2016-07-27 23:09:26 +0200
commitc7ba34b6ea377d21e890e0f8ce30fae70d2e224f (patch)
tree746b5228e65fa2d6efcd42c54f5157ad58e3be0a /libavfilter/af_hdcd.c
parent91854b8ef644207925cdc5d0dda1b130335d89f1 (diff)
downloadffmpeg-streaming-c7ba34b6ea377d21e890e0f8ce30fae70d2e224f.zip
ffmpeg-streaming-c7ba34b6ea377d21e890e0f8ce30fae70d2e224f.tar.gz
af_hdcd: more comments in state struct
Add some comments describing the fields in hdcd_state_t. Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/af_hdcd.c')
-rw-r--r--libavfilter/af_hdcd.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/libavfilter/af_hdcd.c b/libavfilter/af_hdcd.c
index f68a105..72560db 100644
--- a/libavfilter/af_hdcd.c
+++ b/libavfilter/af_hdcd.c
@@ -818,20 +818,28 @@ static const int32_t gaintab[] = {
typedef struct {
uint64_t window;
- unsigned char readahead, arg, control;
- int running_gain;
- unsigned sustain, sustain_reset;
- int code_counterA;
- int code_counterA_almost; /* looks like an A code, but a bit expected to be 0 is 1 */
- int code_counterB;
+ unsigned char readahead;
+
+ /* arg is set when a packet prefix is found.
+ * control is the active control code, where
+ * bit 0-3: target_gain, 4-bit (3.1) fixed-point value
+ * bit 4 : peak_extend
+ * bit 5 : transient_filter
+ * bit 6,7: always zero */
+ unsigned char arg, control;
+ unsigned sustain, sustain_reset; /* code detect timer */
+
+ int running_gain; /* 11-bit (3.8) fixed point, extended from target_gain */
+
+ /* counters */
+ int code_counterA; /* 8-bit format packet */
+ int code_counterA_almost; /* looks like an A code, but a bit expected to be 0 is 1 */
+ int code_counterB; /* 16-bit format packet, 8-bit code, 8-bit XOR of code */
int code_counterB_checkfails; /* looks like a B code, but doesn't pass the XOR check */
- int code_counterC;
- int code_counterC_unmatched; /* told to look for a code, but didn't find one */
-
- /* For user information/stats, pulled up into HDCDContext
- * by filter_frame() */
- int count_peak_extend;
- int count_transient_filter;
+ int code_counterC; /* packet prefix was found, expect a code */
+ int code_counterC_unmatched; /* told to look for a code, but didn't find one */
+ int count_peak_extend; /* valid packets where peak_extend was enabled */
+ int count_transient_filter; /* valid packets where filter was detected */
/* target_gain is a 4-bit (3.1) fixed-point value, always
* negative, but stored positive.
* The 16 possible values range from -7.5 to 0.0 dB in
OpenPOWER on IntegriCloud