OLD | NEW |
1 @TEMPLATE decoder_tmpl.c | 1 @TEMPLATE decoder_tmpl.c |
2 Postprocessing Decoder | 2 Postprocessing Decoder |
3 ====================== | 3 ====================== |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION |
5 This example adds postprocessing to the simple decoder loop. | 5 This example adds postprocessing to the simple decoder loop. |
6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION | 6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION |
7 | 7 |
8 | 8 |
9 Initializing Postprocessing | 9 Initializing Postprocessing |
10 --------------------------- | 10 --------------------------- |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 die_codec(&codec, "Failed to decode frame"); | 44 die_codec(&codec, "Failed to decode frame"); |
45 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE | 45 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE |
46 | 46 |
47 | 47 |
48 Codec Specific Postprocessing Controls | 48 Codec Specific Postprocessing Controls |
49 -------------------------------------- | 49 -------------------------------------- |
50 Some codecs provide fine grained controls over their built-in | 50 Some codecs provide fine grained controls over their built-in |
51 postprocessors. VP8 is one example. The following sample code toggles | 51 postprocessors. VP8 is one example. The following sample code toggles |
52 postprocessing on and off every 15 frames. | 52 postprocessing on and off every 15 frames. |
53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE | 53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE |
54 #if CONFIG_VP8_DECODER | 54 #if CONFIG_VP9_DECODER |
55 if(frame_cnt%30 == 1) { | 55 if(frame_cnt%30 == 1) { |
56 vp8_postproc_cfg_t pp = {0, 0, 0}; | 56 vp8_postproc_cfg_t pp = {0, 0, 0}; |
57 | 57 |
58 if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 58 if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) |
59 die_codec(&codec, "Failed to turn off postproc"); | 59 die_codec(&codec, "Failed to turn off postproc"); |
60 } else if(frame_cnt%30 == 16) { | 60 } else if(frame_cnt%30 == 16) { |
61 vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, 4, 0}; | 61 vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, 4, 0}; |
62 | 62 |
63 if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 63 if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) |
64 die_codec(&codec, "Failed to turn on postproc"); | 64 die_codec(&codec, "Failed to turn on postproc"); |
65 }; | 65 }; |
66 #endif | 66 #endif |
67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE | 67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE |
OLD | NEW |