JP5703532B2 - Transcoding device - Google Patents

Transcoding device Download PDF

Info

Publication number
JP5703532B2
JP5703532B2 JP2011072957A JP2011072957A JP5703532B2 JP 5703532 B2 JP5703532 B2 JP 5703532B2 JP 2011072957 A JP2011072957 A JP 2011072957A JP 2011072957 A JP2011072957 A JP 2011072957A JP 5703532 B2 JP5703532 B2 JP 5703532B2
Authority
JP
Japan
Prior art keywords
frame
compressed
data
frame data
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2011072957A
Other languages
Japanese (ja)
Other versions
JP2012209702A (en
Inventor
進 竹村
進 竹村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Onkyo Corp
Original Assignee
Onkyo Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Onkyo Corp filed Critical Onkyo Corp
Priority to JP2011072957A priority Critical patent/JP5703532B2/en
Publication of JP2012209702A publication Critical patent/JP2012209702A/en
Application granted granted Critical
Publication of JP5703532B2 publication Critical patent/JP5703532B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

この発明は、圧縮データを異なる形式の圧縮データに変換するトランスコード装置に関するものである。   The present invention relates to a transcoding device that converts compressed data into compressed data of a different format.

圧縮データを一旦デコードした後、階調変更、画像サイズ変更、フレームレート変更、インタレース有無の変更、画像縦横比変更、クロップなどを変更する処理を行い、再び圧縮データとするトランスコードが行われている。たとえば、高画質の圧縮AVデータを、携帯機器やインターネットで配信すると、データ量が大きいため、適切な表示がなされないという問題がある。そこで、このような場合、高画質の圧縮AVデータを、配信用の低画質の圧縮AVデータに変換するトランスコードが行われる。   Once the compressed data is decoded, the process of changing the gradation, changing the image size, changing the frame rate, changing the presence / absence of interlace, changing the image aspect ratio, changing the crop, etc. is performed, and transcoding is performed again as compressed data ing. For example, when compressed AV data with high image quality is distributed via a portable device or the Internet, there is a problem in that an appropriate display cannot be performed because the data amount is large. Therefore, in such a case, transcoding for converting high-quality compressed AV data into low-quality compressed AV data for distribution is performed.

また、再圧縮の際に、圧縮方式を変更することも行われている(たとえばMPEG2をMPEG4にするなど)。   In addition, the compression method is changed at the time of recompression (for example, MPEG2 is changed to MPEG4).

従来、このようなトランスコードを行っている途中で、これを一旦中断すると、これまでにトランスコードした部分は破棄して、最初からトランスコードをやり直さなければならなかった。以下、その点について説明する。   In the past, if such transcoding was interrupted, once this was interrupted, the transcoded part had to be discarded and the transcoding had to be performed again from the beginning. This will be described below.

たとえば、MPEG2のデータをMPEG4にトランスコードする場合を考えてみる。図1Aに示すのがMPEG2の元データである。Iは、他のフレームを参照せず単独でデコード可能な圧縮フレームを表している(Iフレームという)。Pは、先行するIフレームを参照することによりデコード可能な圧縮フレームを表している(Pフレームという)。Bは、先行するIまたはPフレームおよび後続するIまたはPフレームの双方を参照することによりデコード可能な圧縮フレームを表している(Bフレームという)。I、P、Bの下に付したF1、F2・・・の符号は、元データのフレーム番号に対応する。なお、図1Aにおけるフレーム番号F1、F2・・・は、説明のために記述したものであり、MPEG2のデータ中にフレーム番号が記述されているわけではない。   For example, consider the case of transcoding MPEG2 data to MPEG4. FIG. 1A shows MPEG2 original data. I represents a compressed frame that can be decoded independently without referring to other frames (referred to as I frame). P represents a compressed frame that can be decoded by referring to the preceding I frame (referred to as a P frame). B represents a compressed frame that can be decoded by referring to both the preceding I or P frame and the subsequent I or P frame (referred to as a B frame). The symbols F1, F2,... Attached below I, P, B correspond to the frame numbers of the original data. Note that the frame numbers F1, F2,... In FIG. 1A are described for explanation, and the frame numbers are not described in the MPEG2 data.

図1Aの元データをデコードすると、図1Bに示すような元データが得られる。F1は1番目のフレーム、F2は2番目のフレーム、F3は3番目のフレーム・・・を表している。図1AのMPEG2のデータと、図1Bの元データとを比べると明らかなように、MPEG2のデータは、再生時のフレーム番号と、データの記録順序が一致していない。Bフレームが後続するフレームを参照しなければデコードできないため、このような記録順序としているのである。   When the original data in FIG. 1A is decoded, the original data as shown in FIG. 1B is obtained. F1 represents the first frame, F2 represents the second frame, F3 represents the third frame,. As is clear from the comparison of the MPEG2 data in FIG. 1A and the original data in FIG. 1B, the MPEG2 data does not match the frame number at the time of reproduction and the data recording order. Since the B frame cannot be decoded unless the subsequent frame is referred to, such a recording order is used.

たとえば、図1AにおけるF1のBフレームは、F3のIフレームを参照しなければデコードできないため、再生時には先に再生されるF1のBフレームよりも前に、再生時には後に再生されるF3のIフレームが記録されているのである。F2のBフレームについても同様である。   For example, since the B frame of F1 in FIG. 1A cannot be decoded without referring to the I frame of F3, the I frame of F3 that is played back before the F frame B that is played back earlier during playback and later. Is recorded. The same applies to the B frame of F2.

デコードによって図1Bのような元データが得られると、次に、この元データをエンコードして図1CのようなMPEG4のデータを得る。このようにして、MPEG2からMPEG4へのトランスコードが行われる。   When the original data as shown in FIG. 1B is obtained by decoding, the original data is then encoded to obtain MPEG4 data as shown in FIG. 1C. In this way, transcoding from MPEG2 to MPEG4 is performed.

上記のトランスコード中に、たとえば、図1CにおけるF4のBフレームまで記録を行った時にトランスコードを中断したとする。   Assume that the transcoding is interrupted when recording is performed up to the B frame of F4 in FIG. 1C during the above transcoding.

その後、トランスコードを再開した際には、いずれのフレームからデコード・エンコードを開始すればよいかを特定するのが困難である。トランスコードされて記録済みのMPEG4データの最後に記録されたフレームF4は、対応する元データの最後のフレームと一致せず、しかも、MPEG4データにはフレーム番号が記録されていない。したがって、再開時に、いずれのフレームからトランスコードを再開すればよいかを特定することが難しくなるのである。   After that, when transcoding is resumed, it is difficult to specify from which frame decoding / encoding should be started. The frame F4 recorded at the end of the transcoded and recorded MPEG4 data does not coincide with the last frame of the corresponding original data, and the frame number is not recorded in the MPEG4 data. Therefore, it becomes difficult to specify from which frame transcoding should be resumed when resuming.

このような問題を解決するため、特許文献1には、ひとかたまりのデータ群であるGOP単位でトランスコードを行い、中断したGOPの最初からトランスコードを再開することが開示されている。   In order to solve such a problem, Patent Document 1 discloses that transcoding is performed in units of GOPs, which are a group of data, and transcoding is restarted from the beginning of the interrupted GOP.

特開2001−094935JP 2001-094935 A

しかしながら、特許文献1の手法では、トランスコード後の圧縮データとしてBフレームを用いることが困難となる。その理由は以下のとおりである。たとえば、図1Bに示す9個のフレームF3〜F11が一つのGOPを構成している。したがって、特許文献1の手法では、この9個のフレームについてトランスコードを行う。通常通りトランスコードを行うと、圧縮データの最後の2つのフレームは、Bフレーム(F10およびF11)となる。この2つのBフレームは、次のGOPであるIフレーム(F12)を参照することになる。しかし、このようにGOPをまたがって、参照を行うことはできない。このため、トランスコード後の圧縮データにおいて、後ろのフレームを参照するBフレームを用いることができなくなる。その結果、トランスコード後の圧縮率を大きくすることができないという問題があった。   However, in the method of Patent Document 1, it is difficult to use a B frame as compressed data after transcoding. The reason is as follows. For example, nine frames F3 to F11 shown in FIG. 1B constitute one GOP. Therefore, in the method of Patent Document 1, transcoding is performed for these nine frames. When transcoding is performed as usual, the last two frames of the compressed data become B frames (F10 and F11). These two B frames refer to the I frame (F12) which is the next GOP. However, reference cannot be made across GOPs in this way. For this reason, in the compressed data after transcoding, the B frame referring to the subsequent frame cannot be used. As a result, there is a problem that the compression rate after transcoding cannot be increased.

また、圧縮率を犠牲にしないため、中断時には、次のGOPを参照するフレームが存在しないようにBフレームとして出力する予定のフレームをPフレームとして出力するという手法も考えられる。しかし、このような中断処理を行うことにした場合、かかる中断処理の途中で不意の電源断等によって強制的に中断されてしまうと、Pフレームが正常に記録されず、トランスコードの再開が困難になるという問題があった。   Further, since the compression rate is not sacrificed, a method of outputting a frame scheduled to be output as a B frame so that there is no frame that refers to the next GOP at the time of interruption can be considered. However, when such interruption processing is performed, if the interruption is forcibly interrupted due to an unexpected power interruption or the like during the interruption processing, the P frame is not normally recorded and it is difficult to resume transcoding. There was a problem of becoming.

この発明は上記のような問題を解決して、適切にトランスコードの再開を行うことのできる装置を提供することを目的とする。   An object of the present invention is to solve the above-described problems and provide an apparatus that can appropriately resume transcoding.

(1)(2)この発明に係るトランスコード装置は、少なくとも単独でデコード可能な単独圧縮フレームデータと、前記単独圧縮フレームデータを参照してデコード可能な参照圧縮フレームデータとを有し、各圧縮フレームデータの順番が、これら圧縮フレームデータに対応する元フレームデータの順番と異なるように構成された第一圧縮ストリームをデコードし、デコード後のストリームを再エンコードして第二圧縮ストリームにする装置であって、第一圧縮ストリームをデコードして元フレームデータを得るデコード手段と、前記デコード手段によって得られた元フレームデータをエンコードして第二圧縮ストリームを得て記録するエンコード手段とを備え、前記エンコード手段は、第二圧縮ストリームにおける後ろのフレームデータを参照する参照圧縮フレームデータの連続部分の記録をすると、第二圧縮ストリームの各フレームの再生順番のうち最も後ろの再生順番と、第二圧縮ストリームの前記最も後ろの再生順番に対応する圧縮フレームデータから前記参照圧縮フレームデータの連続部分の最後のフレームデータまでのフレーム数とをログデータとして記録し、前記デコード手段およびエンコード手段の処理停止後、処理再開時に、前記記録されたログデータの最も後ろの再生順番の次の順番に対応するフレームから処理を再開するよう指示する処理再開指示手段をさらに備えたことを特徴としている。 (1) (2) A transcoding device according to the present invention includes at least single compressed frame data that can be decoded independently, and reference compressed frame data that can be decoded by referring to the single compressed frame data, and A device that decodes the first compressed stream configured so that the order of the frame data is different from the order of the original frame data corresponding to the compressed frame data, and re-encodes the decoded stream into the second compressed stream. A decoding means for decoding the first compressed stream to obtain original frame data, and an encoding means for encoding the original frame data obtained by the decoding means to obtain and record a second compressed stream, The encoding means refers to the subsequent frame data in the second compressed stream. When the continuous portion of the reference compressed frame data is recorded, the last playback order in the playback order of each frame of the second compressed stream and the compressed frame data corresponding to the last playback order of the second compressed stream are The number of frames up to the last frame data of the continuous portion of the reference compressed frame data is recorded as log data, and when the processing is resumed after the processing of the decoding means and encoding means is stopped, the last reproduction of the recorded log data is performed It is characterized by further comprising a process restart instruction means for instructing to restart the process from the frame corresponding to the next order.

したがって、一旦中断したトランスコードを再開してトランスコードを継続することができる。   Therefore, it is possible to resume the transcoding once interrupted and continue the transcoding.

(3)この発明に係るトランスコード装置は、エンコード手段が、前記ログデータとして、最も後ろの再生順番のフレームを含む、ひとかたまりのフレームにおける最も前の再生順番も含めて記録することを特徴としている。 (3) The transcoding device according to the present invention is characterized in that the encoding means records the log data including the earliest reproduction order in a group of frames including the frame of the last reproduction order. .

したがって、再開時に容易に、再開すべきフレームが含まれるひとかたまりのフレームを見つけ出すことができる。   Therefore, it is possible to easily find a group of frames including a frame to be resumed when resuming.

(4)この発明に係るトランスコード装置は、エンコード手段が、前記ログデータとして、最も後ろの再生順番のフレームの種類も含めて記録し、処理再開指示手段が、前記ログデータ中の、最も後ろの再生順番のフレームの種類を参照して、既に記録されている第二の圧縮ストリームの直近の単独圧縮フレームデータから、処理を再開するよう指示することを特徴としている。 (4) In the transcoding device according to the present invention, the encoding means records the log data including the type of the frame in the last reproduction order, and the process restart instruction means records the last data in the log data. With reference to the type of frame in the reproduction order, an instruction is given to restart the processing from the single compressed frame data nearest to the already recorded second compressed stream.

したがって、単独圧縮フレームの密度が高くなり、圧縮率が低下することを防止することができる。   Therefore, it is possible to prevent the density of the single compression frame from increasing and the compression rate from decreasing.

「デコード手段」は、実施形態においては、ステップS1がこれに対応する。   In the embodiment, “decoding means” corresponds to step S1.

「エンコード手段」は、実施形態においては、ステップS2がこれに対応する。   In the embodiment, “encoding means” corresponds to step S2.

「処理再開指示手段」は、実施形態においては、ステップS10〜S15がこれに対応する。   In the embodiment, “process resumption instruction means” corresponds to steps S10 to S15.

「プログラム」とは、CPUにより直接実行可能なプログラムだけでなく、ソース形式のプログラム、圧縮処理がされたプログラム、暗号化されたプログラム等を含む概念である。   The “program” is a concept that includes not only a program that can be directly executed by the CPU, but also a source format program, a compressed program, an encrypted program, and the like.

トランスコードを説明するための図である。It is a figure for demonstrating transcoding. 一実施形態によるトランスコード装置の機能ブロック図である。1 is a functional block diagram of a transcoding device according to one embodiment. FIG. トランスコード装置の処理を説明するための図である。It is a figure for demonstrating the process of a transcoding apparatus. ハードウエア構成を示す図である。It is a figure which shows a hardware configuration. トランスコードプログラム22のフローチャートである。3 is a flowchart of a transcode program 22. ログデータの例を示す図である。It is a figure which shows the example of log data. トランスコードプログラム22のフローチャートである。3 is a flowchart of a transcode program 22. トランスコード装置の処理を説明するための図である。It is a figure for demonstrating the process of a transcoding apparatus.

1.トランスコード装置の機能ブロック図
図2に、この発明の一実施形態によるトランスコード装置の機能ブロック図を示す。デコード手段2は、第一圧縮ストリームをデコードし元フレームデータを復元する。エンコード手段4は、元フレームデータをエンコードし第二圧縮ストリームを生成する。
1. 2 is a functional block diagram of a transcoding device according to an embodiment of the present invention. The decoding means 2 decodes the first compressed stream and restores the original frame data. The encoding unit 4 encodes the original frame data to generate a second compressed stream.

エンコード手段4は、第二圧縮ストリームにおける後ろのフレームデータを参照する参照圧縮フレームデータの連続部分の記録をすると、第二圧縮ストリームの各フレームの再生順番のうち最も後ろの再生順番と、第二圧縮ストリームの前記最も後ろの再生順番に対応する圧縮フレームデータから前記参照圧縮フレームデータの連続部分の最後のフレームデータまでのフレーム数とをログデータ6として記録する。たとえば、図1CのF2のBフレームを記録した時点で、最も大きいフレーム番号(この場合F3)と、当該F3から記録した最後のフレームF2までのフレーム数(この場合2)を記録する。つまり、F3のI、F1のBを記録した時点では、上記ログデータ6は記録せず、F2のBを記録した時点になって、上記ログデータ6を記録する。したがって、ログデータ6には、既に記録されている圧縮フレームのうち、IBBやPBBなど、IまたはPを先頭とする一組のフレームの記録が完了した時点までの情報が記録されることになる。   When the encoding means 4 records the continuous portion of the reference compressed frame data referring to the subsequent frame data in the second compressed stream, the encoding means 4 and the second playback order in the playback order of each frame of the second compressed stream, The number of frames from the compressed frame data corresponding to the last reproduction order of the compressed stream to the last frame data of the continuous portion of the reference compressed frame data is recorded as log data 6. For example, when the B frame of F2 in FIG. 1C is recorded, the largest frame number (F3 in this case) and the number of frames from the F3 to the last frame F2 recorded (2 in this case) are recorded. That is, the log data 6 is not recorded when I of F3 and B of F1 are recorded, and the log data 6 is recorded when B of F2 is recorded. Therefore, the log data 6 is recorded with information up to the point when the recording of a set of frames starting with I or P, such as IBB and PBB, among the already recorded compressed frames is completed. .

たとえば、図3Cに示すように、F4のBまで圧縮フレームを記録した時点でトランスコードの中断があったとする。この場合には、図3Dに示すように、最も後ろの再生フレーム番号として「F3」、当該フレームから最終記録フレームまでのフレーム数として「2」が記録されていることになる。   For example, as shown in FIG. 3C, it is assumed that transcoding is interrupted when a compressed frame is recorded up to B of F4. In this case, as shown in FIG. 3D, “F3” is recorded as the last reproduction frame number, and “2” is recorded as the number of frames from the frame to the final recording frame.

トランスコードを再開する際には、処理再開指示手段8は、記録されているログデータ6を読み出す。このログデータ6に示されている最も後ろの再生フレーム番号「F3」に基づいて、当該再生順番に対応する圧縮データを探し出す。このためには、たとえば、処理再開指示手段8は、記録されたトランスコード後の圧縮フレームのGOPの先頭(図3CのF3のI)からデコードを行い、当該再生順番の圧縮フレームを探し出す。   When restarting transcoding, the process restart instruction means 8 reads the recorded log data 6. Based on the last reproduction frame number “F3” shown in the log data 6, the compressed data corresponding to the reproduction order is searched. For this purpose, for example, the process resumption instructing means 8 performs decoding from the beginning of the GOP of the recorded compressed frame after transcoding (F3 I in FIG. 3C) and searches for the compressed frame in the reproduction order.

なお、この実施形態では、GOP中のフレームにおいて、再生順番が最も早いフレームのフレーム番号(ここではF1)を記録している。したがって、デコードをすることにより、最後に再生される圧縮フレーム(ここではF3のI)を特定することができる。   In this embodiment, the frame number (here, F1) of the frame with the earliest reproduction order is recorded in the frame in the GOP. Therefore, by decoding, it is possible to specify the compressed frame (I of F3 here) to be reproduced last.

したがって、処理再開指示手段8は、このフレーム番号F3の次のフレーム番号F4からトランスコードを再開するように、デコード手段2、エンコード手段4に指示を与える。   Therefore, the process resuming instruction unit 8 gives an instruction to the decoding unit 2 and the encoding unit 4 so as to resume transcoding from the frame number F4 next to the frame number F3.

また、処理再開指示手段8は、ログデータ6に示される、前記最も後ろの再生フレームF3から、記録した最後のフレームF2までのフレーム数(この場合2)を読み出す。そして、上記フレームF3から後ろ2つの圧縮フレームまでを残して、それ以降の圧縮フレームを削除する。図3Cの場合であれば、フレームF6、F4を削除することになる。   Further, the process resumption instructing means 8 reads out the number of frames (in this case 2) from the last reproduced frame F3 to the last recorded frame F2 indicated in the log data 6. Then, the remaining frames from the frame F3 to the last two compressed frames are left and the subsequent compressed frames are deleted. In the case of FIG. 3C, the frames F6 and F4 are deleted.

このようにして、図3Eに示すようにトランスコードされたものが記録されていくことになる。なお、再開時には最初のフレームは、Iフレームとして記録する。   In this way, the transcoded data is recorded as shown in FIG. 3E. When restarting, the first frame is recorded as an I frame.

2.ハードウエア構成
図4に、一実施形態によるトランスコード装置のハードウエア構成を示す。CPU10には、メモリ12、ハードディスク14、CD−ROMドライブ16が接続されている。
2. Hardware Configuration FIG. 4 shows a hardware configuration of a transcoding device according to an embodiment. A memory 12, a hard disk 14, and a CD-ROM drive 16 are connected to the CPU 10.

ハードディスク14には、オペレーティングシステム20、トランスコードプログラム22、トランスコードの対象であるMPEG2データ24が記録されている。トランスコードプログラム22は、オペレーティングシステム20と協働してその機能を発揮する。また、オペレーティングシステム20、トランスコードプログラム22は、CD−ROMドライブ16を介して、CD−ROM18に記録されていたものを、ハードディスク14にインストールしたものである。
The hard disk 14 stores an operating system 20, a transcode program 22, and MPEG2 data 24 to be transcoded. The transcode program 22 performs its function in cooperation with the operating system 20. The operating system 20 and the transcode program 22 are the ones recorded on the CD-ROM 18 and installed on the hard disk 14 via the CD-ROM drive 16.

3.トランスコード処理
ここでは、MPEG2データをMPEG4データにトランスコードする場合について説明する。
3. Transcode Processing Here, a case where MPEG2 data is transcoded to MPEG4 data will be described.

図5に、ハードディスク14に記録されたトランスコードプログラム22のフローチャートを示す。CPU10は、ハードディスク14に記録されているMPEG2データを読み出してデコードし、元フレームを生成する(ステップS1)。この際、CPU10は、生成した元フレームのフレーム番号をカウントして、各元フレームに関連づける。生成した元フレームおよびフレーム番号は、メモリ12またはハードディスク14に一次的に記録される。たとえば、図3Aに示すMPEG2データを読み出し、図3Bに示す元フレームを得る。   FIG. 5 shows a flowchart of the transcode program 22 recorded on the hard disk 14. The CPU 10 reads and decodes the MPEG2 data recorded on the hard disk 14 and generates an original frame (step S1). At this time, the CPU 10 counts the frame number of the generated original frame and associates it with each original frame. The generated original frame and frame number are temporarily recorded in the memory 12 or the hard disk 14. For example, the MPEG2 data shown in FIG. 3A is read to obtain the original frame shown in FIG. 3B.

続いて、CPU10は、デコードして得た元フレームを、MPEG4にエンコードする。一組の元フレームF1、F2、F3についてのエンコードを完了すると、CPU10は、MPEG4データをハードディスク14に記録する(ステップS3)。たとえば、図3Cに示すF3のIフレーム、F1のBフレーム、F2のBフレームが記録される。ただし、圧縮動画ファイルにおいては、一般に、フレーム番号は記録しない。したがって、この実施形態においても、フレーム番号を記録していない。   Subsequently, the CPU 10 encodes the original frame obtained by decoding into MPEG4. When the encoding for the set of original frames F1, F2, and F3 is completed, the CPU 10 records MPEG4 data on the hard disk 14 (step S3). For example, an I frame of F3, a B frame of F1, and a B frame of F2 shown in FIG. 3C are recorded. However, frame numbers are generally not recorded in compressed video files. Therefore, the frame number is not recorded in this embodiment.

一組のMPEG4データがハードディスク14に記録されると、CPU10は、ログデータをハードディスク14に記録する(ステップS4)。ログデータの例を、図6に示す。   When a set of MPEG4 data is recorded on the hard disk 14, the CPU 10 records log data on the hard disk 14 (step S4). An example of log data is shown in FIG.

「最大フレーム番号」は、既に記録したMPEG4データのうち、最も大きいフレーム番号である。ここでは、F3に対応して「3」が最も大きいフレーム番号として記録される。「最終記録フレームまでのフレーム数」は、最も大きい番号を持つフレームが記録されている位置から、最後の位置に記録されているフレームまでのフレーム数である。ここでは、図3CのF3のIフレームから、F2のBフレームまでのフレーム数「2」が記録される。「フレームタイプ」は、最も大きいフレーム番号を持つフレームのタイプである
。ここでは、「」が記録される。「最大フレーム番号を含むGOPの先頭からのバイト数」は、トランスコード後の圧縮データにおいて、最大フレーム番号を持つフレームを含むGOPの先頭の、圧縮データの先頭からのバイト数である。ここでは、たとえば、10バイトが記録される。「GOPの先頭のフレーム番号」は、上記GOPの先頭のフレームのフレーム番号である。ここでは、「1」が記録される。
The “maximum frame number” is the largest frame number among the already recorded MPEG4 data. Here, “3” is recorded as the largest frame number corresponding to F3. “The number of frames until the last recording frame” is the number of frames from the position where the frame having the highest number is recorded to the frame recorded at the last position. Here, the number of frames “2” from the I frame of F3 in FIG. 3C to the B frame of F2 is recorded. “Frame type” is the type of frame having the largest frame number. Here, “ I ” is recorded. The “number of bytes from the beginning of the GOP including the maximum frame number” is the number of bytes from the beginning of the compressed data at the beginning of the GOP including the frame having the maximum frame number in the compressed data after transcoding. Here, for example, 10 bytes are recorded. The “first frame number of GOP” is the frame number of the first frame of the GOP. Here, “1” is recorded.

ログデータの記録が終了すると、CPU10は、トランスコードが終了したかどうかを判断する(ステップS5)。終了していなければ、ステップS1以下を繰り返し実行する。その結果、MPEG2データがMPEG4データに変換されてハードディスク14に記録されていくことになる。また、これとともに、図6に示すように、ログデータが次々と記録されていく。   When the recording of the log data is finished, the CPU 10 determines whether or not the transcoding is finished (step S5). If not completed, step S1 and the subsequent steps are repeatedly executed. As a result, MPEG2 data is converted into MPEG4 data and recorded on the hard disk 14. At the same time, log data is recorded one after another as shown in FIG.

ステップS5において、トランスコードが終了したと判断した場合、CPU10は、処理を終了する。   If it is determined in step S5 that transcoding has ended, the CPU 10 ends the process.

以上のようにして、トランスコードが実行される。なお、トランスコード中に、恣意的に中断する場合や、予期せぬエラーにより中断する場合がある。この場合に、トランスコードを再開する処理を以下説明する。図7に、トランスコードプログラム22の、トランスコード再開時のフローチャートを示す。   As described above, transcoding is executed. Note that there may be an arbitrary interruption during transcoding or an unexpected error. In this case, a process for restarting transcoding will be described below. FIG. 7 shows a flowchart when the transcode program 22 resumes transcoding.

ここでは、図8Cに示すように、F20010のP、F20008のBまで記録した時点で、予期せぬエラーによって中断してしまった場合を例として説明する。なお、図8において、F20010は、表記を省略してF10としている。F20010のP、F20008のB、F20009のBは、フレームF20010までのデコードとエンコード処理が終わると、直ちに書き込みがなされる。したがって、通常は、これら一組のF20010のP、F20008のB、F20009のBは、そろって書き込みがなされることになる。しかし、予期せぬエラーにて中断した場合には、図8Cに示すように、F20010のP、F20008のBまで記録した時点で終了するという事態が生じうる。   Here, as shown in FIG. 8C, a case will be described as an example in which the recording is interrupted due to an unexpected error at the time of recording up to P of F20010 and B of F20008. In FIG. 8, F20010 is abbreviated as F10. F20010 P, F20008 B, and F20009 B are written immediately after the decoding and encoding process up to the frame F20010 is completed. Therefore, normally, these sets of F20010 P, F20008 B, and F20009 B are written together. However, when the process is interrupted due to an unexpected error, as shown in FIG. 8C, a situation may occur in which the process ends when recording is performed up to P of F20010 and B of F20008.

なお、上記のような中断の際には、F20010のP、F20008のB、F20009のBが全て記録されていないので、これらについてのログデータは記録されていない。つまり、ログデータは、F20007のP、F20005のB、F20006のBについて記録がなされた状態となっている。   At the time of the interruption as described above, since P of F20010, B of F20008, and B of F20009 are not recorded, log data for these is not recorded. That is, the log data is in a state where recording is performed for P of F20007, B of F20005, and B of F20006.

まず、CPU10は、ハードディスク14に記録されている最後のログデータを読み出す(ステップS10)。次に、図6の当該ログデータから、最大フレーム番号を取得する。ここでは、「20007」を取得することになる。次に、CPU10は、当該ログデータから、GOPの先頭までのファイルの先頭からのバイト数を取得する。ここでは、「120000000」バイトを取得することになる。さらに、GOPの先頭のフレーム番号を取得する(ステップS11)。ここでは、「20002」を取得することになる。   First, the CPU 10 reads the last log data recorded on the hard disk 14 (step S10). Next, the maximum frame number is acquired from the log data in FIG. Here, “20007” is acquired. Next, the CPU 10 acquires the number of bytes from the beginning of the file up to the beginning of the GOP from the log data. Here, “120000000” bytes are acquired. Further, the top frame number of the GOP is acquired (step S11). Here, “20002” is acquired.

CPU10は、既にトランスコードして記録済みのMPEG4データのGOPの先頭から1フレームずつデコードを行い、上記の最大フレーム番号を有する圧縮フレームを特定する(ステップS12)。つまり、図8Cにおける、F20007のPを特定する。この際、取得したバイト数によりGOPの先頭を容易に見つけ出すことができる。さらに、GOPの先頭フレーム番号が分かっているので、最大フレーム数に対応する圧縮フレームを容易に見いだすことができる。   The CPU 10 decodes frame by frame from the beginning of the GOP of MPEG4 data that has already been transcoded and recorded, and identifies the compressed frame having the maximum frame number (step S12). That is, P of F20007 in FIG. 8C is specified. At this time, the head of the GOP can be easily found based on the acquired number of bytes. Furthermore, since the first frame number of the GOP is known, a compressed frame corresponding to the maximum number of frames can be easily found.

次に、CPU10は、「最終記録フレームまでのフレーム数」を取得する(ステップS13)。ここでは、「2」を取得することになる。CPU10は、特定した最大フレーム番号を有する圧縮フレームから、「最終記録フレームまでのフレーム数」を加えたフレームより後の圧縮フレームを削除する(ステップS14)。ここでは、図8CのF20007のPから2つ後のF20006のBまでを残して、それより後の圧縮データ(F20010のP、F20008のB)を削除する。これにより、記録された圧縮データ(MPEG4データ)は、図8Dのようになる。これは、完全な一組として記録されていない圧縮データを削除するためである。   Next, the CPU 10 acquires “the number of frames up to the final recording frame” (step S13). Here, “2” is acquired. The CPU 10 deletes the compressed frame after the frame added with “the number of frames until the final recording frame” from the compressed frame having the specified maximum frame number (step S14). Here, the data from P of F20007 in FIG. 8C to B of F20006, which is two after, is left, and the compressed data after that (P of F20010, B of F20008) is deleted. Thereby, the recorded compressed data (MPEG4 data) becomes as shown in FIG. 8D. This is to delete compressed data that is not recorded as a complete set.

続いて、CPU10は、最大フレーム番号の次のフレーム番号を、再開するフレーム番号とする(ステップS15)。したがって、CPU10は、MPEG2データをデコードし、再開フレーム番号に対応するフレームを探し出す。その後、図5のフローチャートにしたがってトランスコードを実行する。これにより、図8Eに示すように、F20010のIフレームから記録が再開される。以上のようにして、トランスコードの再開を行うことができる。   Subsequently, the CPU 10 sets the frame number next to the maximum frame number as the frame number to be resumed (step S15). Therefore, the CPU 10 decodes the MPEG2 data and searches for a frame corresponding to the restart frame number. Thereafter, transcoding is executed according to the flowchart of FIG. Thereby, as shown in FIG. 8E, recording is resumed from the I frame of F20010. As described above, transcoding can be resumed.

3.その他の実施形態
(1)上記実施形態では、いずれの箇所において中断したかにより、PフレームとなるべきところがIフレームになってしまい、Iフレームの密度が高くなり圧縮度が低下することになる。再開時に記録される最初の圧縮フレームは、Iフレームとなるからである。この問題に対応するため、ログデータを参照し、圧縮データ(MPEG4)中の直近のIフレームからトランスコードが再開されるように、制御するようにしてもよい。この場合、ステップS14において、当該Iフレーム以下の記録済み圧縮フレームは削除する。
3. Other embodiments
(1) In the above embodiment, depending on which part is interrupted, the place to become the P frame becomes the I frame, and the density of the I frame increases and the compression degree decreases. This is because the first compressed frame recorded at the time of restart is an I frame. In order to deal with this problem, control may be performed so that transcoding is resumed from the latest I frame in the compressed data (MPEG4) with reference to log data. In this case, in step S14, the recorded compressed frames equal to or less than the I frame are deleted.

(2)上記実施形態では、MPEG2データをMPEG4データにトランスコードする場合について説明した。しかし、圧縮データを一旦デコードした後、階調変更、画像サイズ変更、フレームレート変更、インタレース有無の変更、画像縦横比変更、クロップなどを変更する処理を行い、再び圧縮データとする場合などトランスコード一般に適用することができる。 (2) In the above embodiment, the case where MPEG2 data is transcoded to MPEG4 data has been described. However, once the compressed data is decoded, a process such as changing the gradation, changing the image size, changing the frame rate, changing the interlaced presence, changing the image aspect ratio, changing the crop, etc. is performed again. The code can be applied in general.

(3)上記実施形態では、フレーム番号を再生順番としているが、PTSなどを再生順番として用いてもよい。 (3) In the above embodiment, the frame number is used as the playback order, but PTS or the like may be used as the playback order.

Claims (6)

少なくとも単独でデコード可能な単独圧縮フレームデータと、前記単独圧縮フレームデータを参照してデコード可能な参照圧縮フレームデータとを有し、各圧縮フレームデータの順番が、これら圧縮フレームデータに対応する元フレームデータの順番と異なるように構成された第一圧縮ストリームをデコードし、デコード後のストリームを再エンコードして第二圧縮ストリームにする装置であって、
第一圧縮ストリームをデコードして元フレームデータを得るデコード手段と、
前記デコード手段によって得られた元フレームデータをエンコードして第二圧縮ストリームを得て記録するエンコード手段とを備え、
前記エンコード手段は、第二圧縮ストリームにおける後ろのフレームデータを参照する参照圧縮フレームデータの連続部分の記録をすると、第二圧縮ストリームの各フレームの再生順番のうち最も後ろの再生順番と、第二圧縮ストリームの前記最も後ろの再生順番に対応する圧縮フレームデータから前記参照圧縮フレームデータの連続部分の最後のフレームデータまでのフレーム数とをログデータとして記録し、
前記デコード手段およびエンコード手段の処理停止後、処理再開時に、前記記録されたログデータの最も後ろの再生順番の次の順番に対応するフレームから処理を再開するよう指示する処理再開指示手段をさらに備えたことを特徴とするトランスコード装置。
At least single compressed frame data that can be decoded independently, and reference compressed frame data that can be decoded by referring to the single compressed frame data, and the order of each compressed frame data is an original frame corresponding to these compressed frame data A device that decodes a first compressed stream configured differently from the data order and re-encodes the decoded stream into a second compressed stream,
Decoding means for decoding the first compressed stream to obtain original frame data;
Encoding means that encodes the original frame data obtained by the decoding means to obtain and record a second compressed stream;
When the encoding means records the continuous portion of the reference compressed frame data that refers to the subsequent frame data in the second compressed stream, the encoding means, and the second playback order of the frames in the second compressed stream, Recording the number of frames from the compressed frame data corresponding to the last playback order of the compressed stream to the last frame data of the continuous portion of the reference compressed frame data as log data,
A process resumption instruction means for instructing to resume the process from the frame corresponding to the next order of the reproduction order of the last recorded log data when the process is resumed after the processes of the decoding means and the encoding means are stopped. A transcoding device characterized by that.
少なくとも単独でデコード可能な単独圧縮フレームデータと、前記単独圧縮フレームデータを参照してデコード可能な参照圧縮フレームデータとを有し、各圧縮フレームデータの順番が、これら圧縮フレームデータに対応する元フレームデータの順番と異なるように構成された第一圧縮ストリームをデコードし、デコード後のストリームを再エンコードして第二圧縮ストリームにする装置をコンピュータによって実現するためのトランスコードプログラムであって、コンピュータを、
第一圧縮ストリームをデコードして元フレームデータを得るデコード手段と、
前記デコード手段によって得られた元フレームデータをエンコードして第二圧縮ストリームを得て記録するエンコード手段として機能させるためのプログラムであって、
前記エンコード手段は、第二圧縮ストリームにおける後ろのフレームデータを参照する参照圧縮フレームデータの連続部分の記録をすると、第二圧縮ストリームの各フレームの再生順番のうち最も後ろの再生順番と、第二圧縮ストリームの前記最も後ろの再生順番に対応する圧縮フレームデータから前記参照圧縮フレームデータの連続部分の最後のフレームデータまでのフレーム数とをログデータとして記録し、
前記プログラムは、前記コンピュータを、さらに、前記デコード手段およびエンコード手段の処理停止後、処理再開時に、前記記録されたログデータの最も後ろの再生順番の次の順番に対応するフレームから処理を再開するよう指示する処理再開指示手段として機能させること特徴とするトランスコードプログラム。
At least single compressed frame data that can be decoded independently, and reference compressed frame data that can be decoded by referring to the single compressed frame data, and the order of each compressed frame data is an original frame corresponding to these compressed frame data A transcoding program for realizing, by a computer, a device that decodes a first compressed stream configured differently from the data order and re-encodes the decoded stream into a second compressed stream. ,
Decoding means for decoding the first compressed stream to obtain original frame data;
A program for functioning as an encoding unit that encodes the original frame data obtained by the decoding unit to obtain and record a second compressed stream,
When the encoding means records the continuous portion of the reference compressed frame data that refers to the subsequent frame data in the second compressed stream, the encoding means, and the second playback order of the frames in the second compressed stream, Recording the number of frames from the compressed frame data corresponding to the last playback order of the compressed stream to the last frame data of the continuous portion of the reference compressed frame data as log data,
The program restarts the computer from a frame corresponding to the next sequence of the last reproduction order of the recorded log data when the processing is resumed after the decoding unit and the encoding unit stop processing. A transcode program that functions as a process resumption instruction means for instructing
請求項1の装置において、
前記エンコード手段は、前記ログデータとして、最も後ろの再生順番のフレームを含む、ひとかたまりのフレームにおける最も前の再生順番も含めて記録することを特徴とする装置。
Oite the equipment of claim 1,
Said encoding means, said as log data, most including behind playback order of the frame, equipment, characterized in that the recording including the earliest reproduction order in the frame of the loaf.
求項2のプログラムにおいて、
前記エンコード手段は、前記ログデータとして、最も後ろの再生順番のフレームを含む、ひとかたまりのフレームにおける最も前の再生順番も含めて記録することを特徴とするプログラム。
In Motomeko 2 of the program,
Said encoding means, said as the log data, including the rearmost reproduction order of the frame, characterized and to Help program to be recorded including the earliest reproduction order in the frame of the loaf.
請求項1または3の装置において、
前記エンコード手段は、前記ログデータとして、最も後ろの再生順番のフレームの種類も含めて記録し、
前記処理再開指示手段は、前記ログデータ中の、最も後ろの再生順番のフレームの種類を参照して、既に記録されている第二の圧縮ストリームの直近の単独圧縮フレームデータから、処理を再開するよう指示することを特徴とする装置。
Oite the equipment of claim 1 or 3,
The encoding means records the log data including the type of the frame in the last reproduction order,
The process resumption instructing unit resumes the process from the single compressed frame data nearest to the second compressed stream already recorded with reference to the type of the frame in the last reproduction order in the log data. equipment characterized in that it instructs.
請求項2または4のプログラムにおいて、
前記エンコード手段は、前記ログデータとして、最も後ろの再生順番のフレームの種類も含めて記録し、
前記処理再開指示手段は、前記ログデータ中の、最も後ろの再生順番のフレームの種類を参照して、既に記録されている第二の圧縮ストリームの直近の単独圧縮フレームデータから、処理を再開するよう指示することを特徴とするプログラム。
In program according to claim 2 or 4,
The encoding means records the log data including the type of the frame in the last reproduction order,
The process resumption instructing unit resumes the process from the single compressed frame data nearest to the second compressed stream already recorded with reference to the type of the frame in the last reproduction order in the log data. program characterized by instructing.
JP2011072957A 2011-03-29 2011-03-29 Transcoding device Expired - Fee Related JP5703532B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011072957A JP5703532B2 (en) 2011-03-29 2011-03-29 Transcoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011072957A JP5703532B2 (en) 2011-03-29 2011-03-29 Transcoding device

Publications (2)

Publication Number Publication Date
JP2012209702A JP2012209702A (en) 2012-10-25
JP5703532B2 true JP5703532B2 (en) 2015-04-22

Family

ID=47189118

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011072957A Expired - Fee Related JP5703532B2 (en) 2011-03-29 2011-03-29 Transcoding device

Country Status (1)

Country Link
JP (1) JP5703532B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113906764B (en) * 2019-09-23 2023-01-31 谷歌有限责任公司 Method, apparatus and computer readable medium for transcoding video

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3532332B2 (en) * 1995-11-10 2004-05-31 パイオニア株式会社 Image information playback device
JP3922490B2 (en) * 1998-02-27 2007-05-30 ソニー株式会社 Video signal re-encoding device and method and video signal recording and re-encoding device and method
JP2000236541A (en) * 1999-02-15 2000-08-29 Toshiba Corp Transcoder
JP2001094935A (en) * 1999-09-22 2001-04-06 Nec Corp Transcoder, and picture recording reproduction system, and picture recording reproduction method used for them
WO2001082608A1 (en) * 2000-04-21 2001-11-01 Sony Corporation Information processing apparatus and method, program, and recorded medium
JP2006135705A (en) * 2004-11-08 2006-05-25 Hitachi Ltd Method and apparatus for recording/reproducing
JP4614895B2 (en) * 2006-02-21 2011-01-19 シャープ株式会社 Transcoder and transcoding method
JP4551370B2 (en) * 2006-07-18 2010-09-29 株式会社日立製作所 Recording / reproducing apparatus and recording / reproducing method

Also Published As

Publication number Publication date
JP2012209702A (en) 2012-10-25

Similar Documents

Publication Publication Date Title
US20100142917A1 (en) video data reproduction system
JP4380585B2 (en) Video playback device
JP2010022003A (en) Moving image file reproduction device, moving image file reproduction method, and program
JP4362510B2 (en) Recording / playback editing device
JP2004062950A (en) Device and method for processing data, and program
JP5120981B2 (en) Generating video data for special playback
JP2018038064A (en) Still image information processing method
JP6269734B2 (en) Movie data editing device, movie data editing method, playback device, and program
CN101137057A (en) Image device possible to reverse play alleviating time delay and method thereof
JP5703532B2 (en) Transcoding device
JP2007048378A (en) Device and method for recording, recording method program, and recording medium with the recording method program recorded
JP2008271546A (en) Decoding device and decoding method, and information processing apparatus and information processing method
KR20160023777A (en) Picture referencing control for video decoding using a graphics processor
JP4891894B2 (en) Method and apparatus for generating menu
US6999090B2 (en) Data processing apparatus, data processing method, information storing medium, and computer program
JP4682267B1 (en) Progressive download playback method and playback program
US20160117796A1 (en) Content Adaptive Decoder Quality Management
JP2009105477A (en) Reproducing device and reproducing method
JP2007122502A (en) Frame buffer management program, program storage medium and management method
JP2007243414A (en) Recorder
JP2016082266A (en) Recording/reproducing apparatus
JP2004135241A (en) Data processing apparatus, data processing method, and program
JP2014081974A (en) Information processing device and information processing method
JP6049369B2 (en) Image processing apparatus and image processing apparatus control method
JP2011040827A (en) Video recording/reproducing device, and video clip processing method

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20130305

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130930

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140722

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140804

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140919

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150126

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150208

R150 Certificate of patent or registration of utility model

Ref document number: 5703532

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees